Studio Visual Editor
In Studio, the HTTP Connector can work in one of two ways, depending on where it’s placed on a flow:
-
As an HTTP Listener Connector
-
As an HTTP Request Connector
To instance the connector as an HTTP Listener Connector, you must place it into the Source section of a flow (ie: as the first element in the flow):

To instance the connector as an HTTP Request Connector, you must place it into the Process section of a flow (ie: anywhere except the beginning of it):

XML Editor
When writing Mule projects in XML, the HTTP Connector can work in one of two ways, depending on how you create it:
-
As an HTTP Listener Connector
-
As an HTTP Request Connector
To instance the connector as an HTTP Listener Connector, add the following XML tag at the start of a flow:
<
http:listener
config-ref
="HTTP_Listener_Configuration"
path
="/"
/>
This element must reference a global configuration element of the following type:
<http:listener-config
name
=
"HTTP_Listener_Configuration"host
=
"localhost"port
/>`=
"8081"`
To instance the connector as an HTTP Listener Connector, add the following XML tag in any part of a flow:
`<``http:request` `config-ref``=``"HTTP_Request_Configuration"` `path``=``"/"` `method``=``"GET"``/>`
This element must reference a global configuration element of the following type:
<http:request-config name="HTTP_Request_Configuration" host="example.com" port="8081"/>