Connector to handle and perform HTTP requests
Configurations
Listener Config
Configuration element for a HttpListener.
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
Name |
String |
The name of this configuration. With this name can be later referenced. |
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. |
|
|
Parse Request |
Boolean |
By default, the request will be parsed (for example, a multi part request will be mapped as a Mule message with no payload and attributes with each part). If this property is set to false, no parsing will be done, and the payload will always contain the raw contents of the HTTP request. |
true |
|
Connection Types
Listener
Connection provider for a HttpListener, handles the creation of HttpServer instances.
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
TLS Configuration |
Reference to a TLS config element. This will enable HTTPS for this config. |
|
||
Protocol |
Enumeration, one of:
|
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 Strategy |
A retry strategy in case of connectivity errors |
|
||
Disable Validation |
Boolean |
Disables connection validation |
|
Request Config
Configuration element for a HTTP requests.
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
Name |
String |
The name of this configuration. With this name can be later referenced. |
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:
|
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:
|
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 |
|
Parse Response |
Boolean |
By default, the response will be parsed (for example, a multipart response will be mapped as a Mule message with null payload and inbound attachments with each part). If this property is set to false, no parsing will be done, and the payload will always contain the raw contents of the HTTP response. |
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 |
Reference to a TLS config element. This will enable HTTPS for this config. |
|
||
Protocol |
Enumeration, one of:
|
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 Strategy |
A retry strategy in case of connectivity errors |
|
||
Disable Validation |
Boolean |
Disables connection validation |
|
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 Type |
Enumeration, one of:
|
the expected response type (STREAM, MULTIPART, FORM or ANY) |
STREAM |
|
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:
|
Defines if the request should contain a body or not. |
|
|
Request Streaming Mode |
Enumeration, one of:
|
Defines if the request should be sent using streaming or not. |
|
|
Parse Response |
Boolean |
Defines if the HTTP response should be parsed or it's raw contents should be propagated instead. |
|
|
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 |
|
Output
Type |
Any |
Attributes Type |
For Configurations.
Throws
-
HTTP:TOO_MANY_REQUESTS
-
HTTP:CLIENT_SECURITY
-
HTTP:INTERNAL_SERVER_ERROR
-
HTTP:TIMEOUT
-
HTTP:BAD_REQUEST
-
HTTP:CONNECTIVITY
-
HTTP:UNAUTHORIZED
-
HTTP:SERVICE_UNAVAILABLE
-
HTTP:NOT_ACCEPTABLE
-
HTTP:RETRY_EXHAUSTED
-
HTTP:FORBIDDEN
-
HTTP:METHOD_NOT_ALLOWED
-
HTTP:SECURITY
-
HTTP:UNSUPPORTED_MEDIA_TYPE
-
HTTP:PARSING
-
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:
|
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 |
|
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 |
|
||
Parse Request |
Boolean |
By default, the request will be parsed (for example, a multi part request will be mapped as a Mule message with null payload and inbound attachments with each part). If this property is set to false, no parsing will be done, and the payload will always contain the raw contents of the HTTP request. |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors |
|
||
Body |
Any |
#[payload] |
|
|
Headers |
Object |
|
||
Status Code |
Number |
|
||
Reason Phrase |
String |
|
Output
Type |
Any |
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 |
|
|
Algorithm |
String |
|
Insecure |
Boolean |
Key Store
Field | Type | Default Value |
---|---|---|
Path |
String |
|
Type |
|
|
Alias |
String |
|
Key Password |
String |
|
Password |
String |
|
Algorithm |
String |
Reconnect
Field | Type | Default Value |
---|---|---|
Frequency |
Number |
|
Count |
Number |
|
Blocking |
Boolean |
Reconnect Forever
Field | Type | Default Value |
---|---|---|
Frequency |
Number |
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:
|
Repeatable File Store Stream
Field | Type | Default Value |
---|---|---|
Max In Memory Size |
Number |
|
Buffer Unit |
Enumeration, one of:
|
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 |
---|---|---|
Preemptive |
Boolean |
true |
Username |
String |
|
Password |
String |
Digest Authentication
Field | Type | Default Value |
---|---|---|
Username |
String |
|
Password |
String |
Ntlm Authentication
Field | Type | Default Value |
---|---|---|
Domain |
String |
|
Workstation |
String |
|
Username |
String |
|
Password |
String |
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 |