HTTP connector used to handle and perform HTTP requests.

This class only serves as an extension definition. It's configurations are divided on server () and client () capabilities.

Configurations


Listener Config

Configuration element for a HttpListener.

Parameters

Name Type Description Default Value Required

Name

String

The name for this configuration. Connectors reference the configuration with this name.

x 

Connection

The connection types that can be provided to this configuration.

x 

Base Path

String

Base path to use for all requests that reference this config.

 

Listener Interceptors

 

Connection Types

Listener

Connection provider for a HttpListener, handles the creation of HttpServer instances.

Parameters
Name Type Description Default Value Required

TLS Configuration

Tls

Reference to a TLS config element. This will enable HTTPS for this config.

 

Protocol

Enumeration, one of:

  • HTTP

  • HTTPS

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 / 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.

HTTP

 

Host

String

Host where the requests will be sent.

x 

Port

Number

Port where the requests will be received.

x 

Use Persistent Connections

Boolean

If false, each connection will be closed after the first request is completed.

true

 

Connection Idle Timeout

Number

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.

30000

 

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment will fail if the test doesn't pass after exhausting the associated reconnection strategy

 

Associated Sources


Request Config

Configuration element for a HTTP requests.

Parameters

Name Type Description Default Value Required

Name

String

The name for this configuration. Connectors reference the configuration with this name.

x 

Connection

The connection types that can be provided to this configuration.

x 

Base Path

String

Base path to use for all requests that reference this config.

/

 

Follow Redirects

Boolean

Specifies whether to follow redirects or not. Default value is true.

true

 

Send Body Mode

Enumeration, one of:

  • ALWAYS

  • AUTO

  • NEVER

Defines if the request should contain a body or not. If AUTO, it will depend on the method (GET, HEAD and OPTIONS will not send a body).

AUTO

 

Request Streaming Mode

Enumeration, one of:

  • AUTO

  • ALWAYS

  • NEVER

Defines if the request should be sent using streaming or not. If this attribute is not present, the behavior will depend on the type of the payload (it will stream only for InputStream). If set to true, it will always stream. If set to false, it will never stream. As streaming is done the request will be sent user Transfer-Encoding: chunked.

AUTO

 

Enable Cookies

Boolean

If true, cookies received in HTTP responses will be stored, and sent in subsequent HTTP requests.

true

 

Response Timeout

Number

Maximum time that the request element will block the execution of the flow waiting for the HTTP response. If this value is not present, the default response timeout from the Mule configuration will be used.

 

Connection Types

Request

Connection provider for a HTTP request, handles the creation of HttpExtensionClient instances.

Parameters
Name Type Description Default Value Required

Proxy Config

One of:

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.

 

Authentication

Authentication method to use for the HTTP request.

 

TLS Configuration

Tls

Reference to a TLS config element. This will enable HTTPS for this config.

 

Protocol

Enumeration, one of:

  • HTTP

  • HTTPS

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 / 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.

HTTP

 

Host

String

Host where the requests will be sent.

 

Port

Number

Port where the requests will be 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.

 

Use Persistent Connections

Boolean

If false, each connection will be closed after the first request is completed.

true

 

Max Connections

Number

The maximum number of outbound connections that will be kept open at the same time. By default the number of connections is unlimited.

-1

 

Connection Idle Timeout

Number

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.

30000

 

Response Buffer Size

Number

The space in bytes for the buffer where the HTTP response will be stored as it arrives.

10240

 

Client Socket Properties

 

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment will fail if the test doesn't pass after exhausting the associated reconnection strategy

 

Associated Operations

Operations

Request

Consumes an HTTP service.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

Method

String

The HTTP method for the request.

GET

 

Output Mime Type

String

The mime type of the payload that this operation outputs.

 

Output Encoding

String

The encoding of the payload that this operation outputs.

 

Streaming Strategy

Configure if repeatable streams should be used and their behaviour

 

Path

String

Path where the request will be sent.

 

URL

String

URL where to send the request.

 

Follow Redirects

Boolean

Specifies whether to follow redirects or not.

 

Send Body Mode

Enumeration, one of:

  • ALWAYS

  • AUTO

  • NEVER

Defines if the request should contain a body or not.

 

Request Streaming Mode

Enumeration, one of:

  • AUTO

  • ALWAYS

  • NEVER

Defines if the request should be sent using streaming or not.

 

Response Timeout

Number

Maximum time that the request element will block the execution of the flow waiting for the HTTP response.

 

Body

Any

The body of the response message

#[payload]

 

Headers

Object

HTTP headers the message should include.

 

URI Parameters

Object

URI parameters that should be used to create the request.

 

Query Parameters

Object

Query parameters the request should include.

 

Response Validator

Configures error handling of the response.

 

Target Variable

String

The name of a variable on which the operation's output will be placed

 

Target Value

String

An expression that will be evaluated against the operation's output and the outcome of that expression will be stored in the target variable

#[payload]

 

Reconnection Strategy

A retry strategy in case of connectivity errors

 

Output

Type

Binary

Attributes Type

For Configurations.

Throws

  • HTTP:BAD_REQUEST  

  • HTTP:INTERNAL_SERVER_ERROR  

  • HTTP:CLIENT_SECURITY  

  • HTTP:TOO_MANY_REQUESTS  

  • HTTP:UNSUPPORTED_MEDIA_TYPE  

  • HTTP:CONNECTIVITY  

  • HTTP:NOT_ACCEPTABLE  

  • HTTP:TIMEOUT  

  • HTTP:UNAUTHORIZED  

  • HTTP:METHOD_NOT_ALLOWED  

  • HTTP:RETRY_EXHAUSTED  

  • HTTP:FORBIDDEN  

  • HTTP:PARSING  

  • HTTP:SECURITY  

  • HTTP:NOT_FOUND  

  • HTTP:SERVICE_UNAVAILABLE  

Basic Security Filter

Authenticates received HTTP requests. Must be used after a listener component.

Parameters

Name Type Description Default Value Required

Realm

String

Authentication realm.

x 

Security Providers

Array of String

The delegate-security-provider to use for authenticating. Use this in case you have multiple security managers defined in your configuration.

 

Attributes

The HttpRequestAttributes coming from an HTTP listener source to check the 'Authorization' header.

#[attributes]

 

Throws

  • HTTP:BASIC_AUTHENTICATION  

  • MULE:SERVER_SECURITY  

Load Static Resource

Serves up static content for use with HTTP, using the request path to lookup the resource.

Parameters

Name Type Description Default Value Required

Resource Base Path

String

The resource base from where documents are served up. For example: /Users/maxthemule/resources

x 

Default File

String

The default file to serve when a directory is specified. The default value is 'index.html'.

index.html

 

Attributes

The HttpRequestAttributes coming from an HTTP listener source to check the required resources.

#[attributes]

 

Target Variable

String

The name of a variable on which the operation's output will be placed

 

Target Value

String

An expression that will be evaluated against the operation's output and the outcome of that expression will be stored in the target variable

#[payload]

 

Output

Type

Any

Throws

  • HTTP:NOT_FOUND  

Sources

Listener

Represents a listener for HTTP requests.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

Path

String

Relative path from the path set in the HTTP Listener configuration

x 

Allowed Methods

String

Comma separated list of allowed HTTP methods by this listener. To allow all methods do not defined the attribute.

 

Response Streaming Mode

Enumeration, one of:

  • AUTO

  • ALWAYS

  • NEVER

Defines if the response should be sent using streaming or not. If this attribute is not present, the behavior will depend on the type of the payload (it will stream only for InputStream). If set to true, it will always stream. If set to false, it will never stream. As streaming is done the response will be sent user Transfer-Encoding: chunked.

AUTO

 

Output Mime Type

String

The mime type of the payload that this operation outputs.

 

Output Encoding

String

The encoding of the payload that this operation outputs.

 

Redelivery Policy

Defines a policy for processing the redelivery of the same message

 

Streaming Strategy

Configure if repeatable streams should be used and their behaviour

 

Reconnection Strategy

A retry strategy in case of connectivity errors

 

Body

Any

#[payload]

 

Headers

Object

 

Status Code

Number

 

Reason Phrase

String

 

Output

Type

Binary

Attributes Type

For Configurations.

Throws

  • MULE:SOURCE_RESPONSE_SEND  

  • MULE:SOURCE_ERROR_RESPONSE_SEND  

  • MULE:SOURCE_ERROR_RESPONSE_GENERATE  

  • MULE:SOURCE_RESPONSE_GENERATE  

Types

Tls

Field Type Default Value

Enabled Protocols

String

Enabled Cipher Suites

String

Trust Store

Key Store

Trust Store

Field Type Default Value

Path

String

Password

String

Type

  • Enumeration, one of:

    • jks

    • jceks

    • pkcs12

  • String

Algorithm

String

Insecure

Boolean

Key Store

Field Type Default Value

Path

String

Type

  • Enumeration, one of:

    • jks

    • jceks

    • pkcs12

  • String

Alias

String

Key Password

String

Password

String

Algorithm

String

Reconnection

Field Type Default Value

Fails Deployment

Boolean

Reconnection Strategy

Reconnect

Field Type Default Value

Frequency

Number

Count

Number

Reconnect Forever

Field Type Default Value

Frequency

Number

Cors Interceptor Wrapper

Field Type Default Value

Cors Interceptor

Cors Listener Interceptor

Field Type Default Value

Allow Credentials

Boolean

false

Origins

Array of One of:

Http Request Attributes

Field Type Default Value

Client Certificate

Any

Headers

Object

Listener Path

String

Method

String

Query Params

Object

Query String

String

Relative Path

String

Remote Address

String

Request Path

String

Request Uri

String

Scheme

String

Uri Params

Object

Version

String

Redelivery Policy

Field Type Default Value

Max Redelivery Count

Number

Use Secure Hash

Boolean

Message Digest Algorithm

String

Id Expression

String

Object Store Ref

String

Repeatable In Memory Stream

Field Type Default Value

Initial Buffer Size

Number

Buffer Size Increment

Number

Max Buffer Size

Number

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

Repeatable File Store Stream

Field Type Default Value

Max In Memory Size

Number

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

Tcp Client Socket Properties

Field Type Default Value

Connection Timeout

Number

30000

Send Tcp No Delay

Boolean

true

Linger

Number

Keep Alive

Boolean

false

Fail On Unresolved Host

Boolean

true

Send Buffer Size

Number

Receive Buffer Size

Number

Client Timeout

Number

Reuse Address

Boolean

true

Http Response Attributes

Field Type Default Value

Headers

Object

Reason Phrase

String

Status Code

Number

Basic Authentication

Field Type Default Value

Username

String

Password

String

Preemptive

Boolean

true

Digest Authentication

Field Type Default Value

Username

String

Password

String

Preemptive

Boolean

true

Ntlm Authentication

Field Type Default Value

Domain

String

Workstation

String

Username

String

Password

String

Preemptive

Boolean

true

Proxy

Field Type Default Value

Host

String

Port

Number

Username

String

Password

String

Ntlm Proxy

Field Type Default Value

Ntlm Domain

String

Host

String

Port

Number

Username

String

Password

String

Success Status Code Validator

Field Type Default Value

Values

String

Failure Status Code Validator

Field Type Default Value

Values

String

Origin

Field Type Default Value

Url

String

Access Control Max Age

Number

Allowed Methods

Array of Method

Allowed Headers

Array of Header

Expose Headers

Array of Header

Method

Field Type Default Value

Method Name

String

Field Type Default Value

Header Name

String