Contact Us 1-800-596-4880

HTTP Connector Reference

Mule Utilities for HTTP Services.

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

Path to listen for incoming requests.
Type: string
Required: yes
Default: none

allowedMethods

Comma-separated list of allowed HTTP methods by this listener. To allow all methods, do not define the attribute.
Type: string
Required: no
Default: none

config-ref

A reference to the configuration element for this listener. If no reference is provided, a default configuration is created.
Type: string
Required: yes
Default: none

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.
Transfer-Encoding: chunked.
Type: enumeration
Required: no
Default: AUTO

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.
Type: string
Required: no
Default: none

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.
Type: name (no spaces)
Required: yes

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.
Type: httpProtocol
Required: no
Default: HTTP

host

Host where requests are sent.
Type: string
Required: yes
Default: none

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
Required: no
Default: none

basePath

Base path to use for all requests that reference this config.
Type: string
Required: no
Default: none

tlsContext-ref

Reference to a TLS config element. This enables HTTPS for this config.
Type: string
Required: no
Default: none

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.
Type: string
Required: no
Default: none

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
Required: no
Default: 30000

usePersistentConnections

If false, each connection is closed after the first request is completed.
Type: boolean
Required: no
Default: true

Child Elements of listener-config

Name Cardinality

tls:context

0..1

worker-threading-profile

0..1

HTTP Response Builder

Attributes of response-builder

No attributes of response-builder. No child elements of response-builder.

Request

Attributes of request

Name Description

path

Path where the request is sent.
Type: string
Required: yes
Default: none

method

The HTTP method for the request.
Type: string
Required: no
Default: none

config-ref

A reference to the configuration element for this requester. If no reference is provided, a default configuration is created.
Type: string
Required: yes
Default: none

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.
Type: string
Required: no
Default: none

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.
Type: string
Required: no
Default: #payload

followRedirects

Specifies whether to follow redirects or not.
Type: boolean
Required: no
Default: true

host

Host where requests are sent.
Type: string
Required: no
Default: none

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.
Type: integer
Required: no
Default: none

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.
Type: boolean
Required: no
Default: true

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.
Type: enumeration
Required: no
Default: AUTO

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).
Type: enumeration
Required: no
Default: AUTO

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.
Type: integer
Required: no
Default: 10 seconds

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: String (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.
Type: httpProtocol
Required: no
Default: HTTP

name

Identifies the configuration in the registry, so that it can be referenced by the request message processor.
Type: name (no spaces)
Required: yes Default: none

basePath

Base path to use for all requests that reference this config.
Type: string
Required: no
Default: none

tlsContext-ref

Reference to a TLS context element. This enables HTTPS for this config.
Type: string
Required: no
Default: none

clientSocketProperties-ref

Reference to a TCP Client Socket properties element.
Type: string
Required: no
Default: none

proxy-ref

Reference to a proxy context element.
Type: string
Required: no
Default: none

maxConnections

The maximum number of outbound connections that is kept open at the same time. By default the number of connections is unlimited.
Type: integer
Required: no
Default: -1

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
Required: no
Default: 30000

usePersistentConnections

If false, each connection is closed after the first request is completed.
Type: boolean
Required: no
Default: true

followRedirects

Specifies whether to follow redirects or not.
Type: boolean
Required: no
Default: true

host

Host where the requests are sent.
Type: string
Required: no
Default: none

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.
Type: integer
Required: no
Default: none

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.
Type: boolean
Required: no
Default: true

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.
Type: enumeration
Required: no
Default: AUTO

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).
Type: enumeration
Required: no
Default: AUTO

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.
Type: integer
Required: no
Default: 10 seconds

enableCookies

When set to true, this attribute gathers cookies from each response it receives, and then send them on subsequent requests.
Type: boolean
Required: no
Default: false

streamResponse

Whether or not received responses should be streamed, meaning processing will continue as soon as all headers are parsed and the body streamed as it arrives. When enabled, the response MUST be eventually read since depending on the configured buffer size it may not fit into memory and processing will stop until space is available.
Data Type: substitutableBoolean
Default Value: false

responseBufferSize

The number of bytes assigned to the response buffer.
Data Type: substitutableInt
Default Value: 10240

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.
Type: string
Required: yes
Default: none

password

The password to authenticate.
Type: string
Required: yes
Default: none

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.
Type: boolean
Required: no
Default: false

No child elements of basic-authentication.

Digest Authentication

Configures digest authentication for the requests.

Attributes of digest-authentication

Name Description

username

The username to authenticate.
Type: string
Required: yes
Default: none

password

The password to authenticate.
Type: string
Required: yes
Default: none

No child elements of digest-authentication.

NTLM Authentication

Configures NTLM authentication for the requests.

Attributes of ntlm-authentication

Name Description

username

The username to authenticate.
Type: string
Required: yes
Default: none

password

The username to authenticate.
Type: string
Required: yes
Default: none

domain

The domain to authenticate.
Type: string
Required: no
Default: none

workstation

The workstation to authenticate.
Type: string
Required: no
Default: none

No child elements of ntlm-authentication.

The NTLM domain name is case sensitive. Verify that the case is correct to avoid authentication problems.

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.

Attributes of Proxy

name: Identifies the proxy configuration in the registry, so that it can be referenced by the request config. Type: name (no spaces)
Required: yes
Default: none

No child elements of proxy.

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.

Attributes of ntlm-proxy

name: Identifies the proxy configuration in the registry, so that it can be referenced by the request config. Type: name (no spaces)
Required: yes
Default: no

No child elements of ntlm-proxy.

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

View on GitHub