path
HTTP Connector Reference
Mule Utilities for HTTP Services.
This page serves as a reference for all of the supported attributes and child elements of the HTTP Connector.
Listener
Listener for incoming HTTP requests.
Attributes of listener
Name | Description |
---|---|
Path to listen for incoming requests. |
|
allowedMethods |
Comma separated list of allowed HTTP methods by this listener. To allow all methods, do not define the attribute. |
config-ref |
A reference to the configuration element for this listener. If no reference is provided, a default configuration is created. |
responseStreamingMode |
Defines if the response should be sent using streaming or not. If this attribute is not present, the behavior depends on the type of the payload (it streams only for InputStream). If set to true, it always streams. If set to false, it never streams. As streaming is done, the response is sent to the user. |
parseRequest |
By default, the request is parsed (for example, a multi-part request is mapped as a Mule message with null payload and inbound attachments with each part). If this property is set to false, no parsing is done, and the payload always contains the raw contents of the HTTP request. |
Child Elements of listener
Name | Cardinality | Description |
---|---|---|
response-builder |
0..1 |
Contains the definition of all the parameters that should be sent in the response (headers, status code, response phrase). |
error-response-builder |
0..1 |
Contains the definition of all the parameters that should be sent in the response (headers, status code, response phrase). |
Listener config
Grouping configuration for a set of listener elements.
Attributes of listener-config
Name | Description |
---|---|
name |
Identifies the configuration in the registry, so that it can be referenced by the request message processor. |
protocol |
Protocol to use for communication. Valid values are HTTP and HTTPS. Default value is HTTP. When using HTTPS the HTTP communication is going to be secured using TLS or SSL. If HTTPS was configured as protocol, then the user needs to configure at least the keystore in the tls:context child element of this listener-config. |
host |
Host where requests are sent. |
port |
Port where the requests are received. If the protocol attribute is HTTP (default) then the default value is 80, if the protocol attribute is HTTPS then the default value is 443.
Type: integer |
basePath |
Base path to use for all requests that reference this config. |
tlsContext-ref |
Reference to a TLS config element. This enables HTTPS for this config. |
parseRequest |
By default, the request is parsed (for example, a multi part request is mapped as a Mule message with null payload and inbound attachments with each part). If this property is set to false, no parsing is done, and the payload always contains the raw contents of the HTTP request. |
connectionIdleTimeout |
The number of milliseconds that a connection can remain idle before it is closed. The value of this attribute is only used when persistent connections are enabled.
Type: integer |
usePersistentConnections |
If false, each connection is closed after the first request is completed. |
Request
Attributes of request
Name | Description |
---|---|
path |
Path where the request is sent. |
method |
The HTTP method for the request. |
config-ref |
A reference to the configuration element for this requester. If no reference is provided, a default configuration is created. |
source |
The expression used to obtain the body that is sent in the request. Default is empty, so the payload is used as the body. |
target |
The enricher expression used to enrich the current message with the body of the response. Default is "#payload", so after processing the response, the contents of its body is set as payload of the message. |
followRedirects |
Specifies whether to follow redirects or not. |
host |
Host where requests are sent. |
port |
Port where the requests is sent. If the protocol attribute is HTTP (default) then the default value is 80, if the protocol attribute is HTTPS then the default value is 443. |
parseResponse |
By default, the response is parsed (for example, a multi part response is mapped as a Mule message with null payload and inbound attachments with each part). If this property is set to false, no parsing is done, and the payload always contains the raw contents of the HTTP response. |
requestStreamingMode |
Defines if the request should be sent using streaming or not. If this attribute is not present, the behavior depends on the type of the payload (it streams only for InputStream). If set to true, it always streams. If set to false, it never streams. As streaming is done the request is sent user Transfer-Encoding: chunked. |
sendBodyMode |
Defines if the request should contain a body or not. If AUTO, it depends on the method (GET, HEAD, and OPTIONS do not send a body). |
responseTimeout |
Maximum time that the request element blocks the execution of the flow waiting for the HTTP response. If this value is not present, the default response timeout from the Mule configuration is used. |
Child Elements of request
Name | Cardinality | Description |
---|---|---|
request-builder |
0..1 |
Contains the definition of all the parameters that should be sent in the request (uri params, query params and headers). |
success-status-code-validator |
0..1 |
Configures error handling of the response based on the status code. |
failure-status-code-validator |
0..1 |
Configures error handling of the response based on the status code. |
Request Builder
Attributes of request-builder
name
: Identifies the builder so that other elements can reference it.
* Type: name (no spaces)
* Required: no
No child elements of request-builder
Attributes of request-config
Name | Description |
---|---|
protocol |
Protocol to use for communication. Valid values are HTTP and HTTPS. Default value is HTTP. When using HTTPS the HTTP communication is going to be secured using TLS and SSL. If HTTPS was configured as protocol then the user can customize the tls/ssl configuration by defining the tls:context child element of this listener-config. If not tls:context is defined then the default JVM certificates are going to be used to establish communication. |
name |
Identifies the configuration in the registry, so that it can be referenced by the request message processor. |
basePath |
Base path to use for all requests that reference this config. |
tlsContext-ref |
Reference to a TLS context element. This enables HTTPS for this config. |
clientSocketProperties-ref |
Reference to a TCP Client Socket properties element. |
proxy-ref |
Reference to a proxy context element. |
maxConnections |
The maximum number of outbound connections that is kept open at the same time. By default the number of connections is unlimited. |
connectionIdleTimeout |
The number of milliseconds that a connection can remain idle before it is closed. The value of this attribute is only used when persistent connections are enabled. |
usePersistentConnections |
If false, each connection is closed after the first request is completed. |
followRedirects |
Specifies whether to follow redirects or not. |
host |
Host where the requests are sent. |
port |
Port where the requests are sent. If the protocol attribute is HTTP (default) then the default value is 80, if the protocol attribute is HTTPS then the default value is 443. |
parseResponse |
By default, the response is parsed (for example, a multi part response is mapped as a Mule message with null payload and inbound attachments with each part). If this property is set to false, no parsing is done, and the payload always contain the raw contents of the HTTP response. |
requestStreamingMode |
Defines if the request should be sent using streaming or not. If this attribute is not present, the behavior depends on the type of the payload (it streams only for InputStream). If set to true, it always streams. If set to false, it never streams. As streaming is done the request is sent user Transfer-Encoding: chunked. |
sendBodyMode |
Defines if the request should contain a body or not. If AUTO, it depends on the method (GET, HEAD, and OPTIONS do not send a body). |
responseTimeout |
Maximum time that the request element blocks the execution of the flow waiting for the HTTP response. If this value is not present, the default response timeout from the Mule configuration is used. |
Child Elements of request-config
Name | Cardinality | Description |
---|---|---|
abstract-http-request-authentication-provider |
0..1 |
A security manager is a container for security providers. More than one security manager may be configured; each contains providers from a particular module and has that module type. This element is abstract - a security-related module or transport provides a suitable implementation. |
tcp:client-socket-properties |
0..1 |
|
tls:context |
0..1 |
|
raml-api-configuration |
0..1 |
Specifies a RAML configuration file for the API that is being consumed. |
proxy |
0..1 |
Reusable configuration element for outbound connections through a proxy. A proxy element must define a host name and a port attributes, and optionally can define a username and a password. |
ntlm-proxy |
0..1 |
Reusable configuration element for outbound connections through a proxy. A proxy element must define a host name and a port attributes, and optionally can define a username and a password. |
Basic Authentication
Configures basic authentication for the requests. Attributes of basic-authentication
Name | Description |
---|---|
username |
The username to authenticate. |
password |
The password to authenticate. |
preemptive |
Configures if authentication should be preemptive or not. Preemptive authentication sends the authentication header in the first request, instead of waiting for a 401 response code to send it. |
No child elements of basic-authentication.
NTLM Authentication
Configures NTLM authentication for the requests.
Attributes of ntlm-authentication
Name | Description |
---|---|
username |
The username to authenticate. |
password |
The username to authenticate. |
domain |
The domain to authenticate. |
workstation |
The workstation to authenticate. |
No child elements of ntlm-authentication.
Proxy
Reusable configuration element for outbound connections through a proxy. A proxy element must define a host name and a port attributes, and optionally can define a username and a password.
NTLM Proxy
Reusable configuration element for outbound connections through a proxy. A proxy element must define a host name and a port attributes, and optionally can define a username and a password.
Config
HTTP global configuration.
Attributes of config
useTransportForUris
: Backwards Compatibility Flag: Since Mule 3.6, default HTTP URIs are resolved with the new HTTP connector (for example when using MuleClient). If set to true, this behavior is changed so that the HTTP transport is used.
Type: boolean
Required: no
Default: false