Creating Application Networks7% of the exam
Consuming REST APIs with HTTP Request
Configure the HTTP Request operation to call a REST API and predict the exact request it sends: base path plus path, URI and query parameters, the default GET method and its empty body, form bodies, response validators that decide when HTTP:NOT_FOUND is raised, and the response timeout.
Apply correct processors / syntax and predict outcomes to consume RESTful web services (RAML-based) and predict outcomes.
~8 min read · 6 practice questions ·
What the exam expects
- Choose the documented way to call a REST API from a Mule 4 app: an HTTP Request operation (or an existing Exchange connector), not a Listener, Web Service Consumer or Database operation.
- Predict the exact URL an HTTP Request sends from its configuration's host, port and base path, the operation's path, and its
uri-paramsandquery-params. - Predict the method and body sent: the default method is GET, GET sends no body, and a DataWeave
http:bodywith a form-urlencoded output sendskey=value&.... - Use a response validator to treat a status such as 404 as success instead of raising
HTTP:NOT_FOUND. - Raise the response timeout when a slow API fails with
HTTP:TIMEOUT.
Key terms:
- Request configuration (
http:request-config): the global element holding the connection (host, port, protocol) and defaults such as base path and response timeout. - URI parameter: a value substituted into a
{placeholder}in the path. - Query parameter: a key/value pair appended after
?. - Response validator: the rule that decides which status codes count as success.
Key facts
Default method
- Detail
- GET
Methods sending no body
- Detail
- GET and OPTIONS (HEAD too under Send Body Mode AUTO)
Default body
- Detail
#[payload]
Base Path default
- Detail
/, applied to all requests referencing the config
Default port
- Detail
- 80 for HTTP, 443 for HTTPS
Default validation
- Detail
- Status 400 or above raises an error
404 error type
- Detail
HTTP:NOT_FOUND
Response Timeout default
- Detail
- Inherited from
defaultResponseTimeout, 10000 ms
Follow Redirects default
- Detail
true
SOAP without a connector
- Detail
- Web Service Consumer connector
Form body result
- Detail
key1=value1&key2=value2, Content-Type form-urlencoded
Sources for this section (5)
- HTTP Connector Referencedocs.mulesoft.com (opens in a new tab)
- Configure HTTP Request Operationdocs.mulesoft.com (opens in a new tab)
- Error Handlersdocs.mulesoft.com (opens in a new tab)
- Global Settings Configurationdocs.mulesoft.com (opens in a new tab)
- Consume Data from an APIdocs.mulesoft.com (opens in a new tab)
- When a URI parameter is defined more than once in the same request, which value does the connector use?
- Why does a 500 response stop the flow even though the server answered?
- What URL does path
/customer/{customerID}with URI parametercustomerID=20produce on hostwww.example.com? - When a success status code validator lists
200,201, what happens to a response with any other status value? - What port does a request use when the protocol is HTTPS and no port is set?
The questions are free to read. Answers with their sources and self-grading are included with the pack.
Keep reading with the MuleSoft Developer pack
- Core concepts
- Exam traps
- Worked scenario
The pack includes:
- All 40 lessons of the MuleSoft Developer guide, with reading progress
- Interactive decision walks and step-by-step sequence steppers
- Practice exams purchase adds inline bank questions and topic practice (6 questions for this lesson)
- An official source cited for every claim
- An AI tutor that answers from the guide
- Unlimited timed practice exams