What is the default HTTP status code returned for a successful message, and how can it be changed?

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

What is the default HTTP status code returned for a successful message, and how can it be changed?

Explanation:
The main idea is that a successful HTTP response starts with status 200. In a Mule flow, if you don’t specify a status, the HTTP connector uses 200 automatically for a successful message. To change this, you override the outgoing HTTP status by setting the message’s outbound property named httpstatus. When you assign a value to that property (for example, message.outboundProperties.'httpstatus' = 201), Mule uses that code for the response instead of 200. This is how you signal different outcomes like “Created” (201) or “No Content” (204) from your flow. The other options describe different outcomes or errors and aren’t the default behavior for a successful response.

The main idea is that a successful HTTP response starts with status 200. In a Mule flow, if you don’t specify a status, the HTTP connector uses 200 automatically for a successful message. To change this, you override the outgoing HTTP status by setting the message’s outbound property named httpstatus. When you assign a value to that property (for example, message.outboundProperties.'httpstatus' = 201), Mule uses that code for the response instead of 200. This is how you signal different outcomes like “Created” (201) or “No Content” (204) from your flow. The other options describe different outcomes or errors and aren’t the default behavior for a successful response.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy