About Receiving HTTP Requests
The HTTP connector has a Listener operation that receives requests over HTTP or HTTPS protocol. Receiving a request, and other incidents, initiate a Mule event. The event passes the request body to the next element of the flow as the message payload. In addition to the payload, the Mule message includes attributes. You can refer to attributes, such as headers, query parameters, and so on using HttpRequestAttributes syntax.
The following diagram explains how to access information about the request.
You use DataWeave syntax to access this information.
The response to a request can include the following information:
You can configure a response for a successful or failed execution of the flow of the listener. By default, the former presents the payload as a body and yields a 200 status code. By default, the latter presents the error description as a body and yields a 500 status code.
The HTTP method most often configured for an HTTP or HTTPS Listener operation is GET. The HTTP Listener default allows all the HTTP Methods. Follow the best practice to limit the allowed HTTP methods to only the method or methods for your app.
Configure Allowed Methods in Advanced:
You can use Transport Layer Security (TLS) and configure HTTPS by providing a key store with your certificate. You can also enable 2-way authentication by providing a trust store. For details, see Configure TLS with Keystores and Truststores.