Which property is used to set the HTTP status code in the outbound response within a flow?

Study for the MuleSoft Associate / Development Fundamental Test. Master key concepts with flashcards and multiple choice questions, complete with hints and explanations. Prepare thoroughly for your exam!

Multiple Choice

Which property is used to set the HTTP status code in the outbound response within a flow?

Explanation:
Setting the HTTP status of the outbound response is done through the message’s outbound properties. In a flow, the HTTP component looks at outboundProperties to determine what to send back, including the status code. To set the status, you assign the desired numeric code to the http.status key on the outboundProperties map (for example, message.outboundProperties.'http.status' = 404). This is the correct mechanism because inboundProperties pertain to the incoming request, not the response, and there isn’t a separate response.status field used in the flow to control the HTTP code. Using outbound properties ensures the HTTP listener sends back the code you specify.

Setting the HTTP status of the outbound response is done through the message’s outbound properties. In a flow, the HTTP component looks at outboundProperties to determine what to send back, including the status code. To set the status, you assign the desired numeric code to the http.status key on the outboundProperties map (for example, message.outboundProperties.'http.status' = 404). This is the correct mechanism because inboundProperties pertain to the incoming request, not the response, and there isn’t a separate response.status field used in the flow to control the HTTP code. Using outbound properties ensures the HTTP listener sends back the code you specify.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy