InvokeHTTP
Description
An HTTP client processor which can interact with a configurable HTTP Endpoint. The destination URL and HTTP Method are configurable. When the HTTP Method is PUT, POST or PATCH, the FlowFile contents are included as the body of the request and FlowFile attributes are converted to HTTP headers, optionally, based on configuration properties.
Tags
client, http, https, rest
Properties
In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.
Display Name | API Name | Default Value | Allowable Values | Description |
---|---|---|---|---|
HTTP Method * | HTTP Method | GET | HTTP request method (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS). Arbitrary methods are also supported. Methods other than POST, PUT and PATCH will be sent without a message body. Supports Expression Language, using FlowFile attributes and Environment variables. | |
HTTP URL * | HTTP URL | HTTP remote URL including a scheme of http or https, as well as a hostname or IP address with optional port and path elements. Any encoding of the URL must be done by the user. Supports Expression Language, using FlowFile attributes and Environment variables. | ||
HTTP/2 Disabled * | HTTP/2 Disabled | False |
| Disable negotiation of HTTP/2 protocol. HTTP/2 requires TLS. HTTP/1.1 protocol supported is required when HTTP/2 is disabled. |
SSL Context Service | SSL Context Service | Controller Service: SSLContextService Implementations: StandardRestrictedSSLContextService StandardSSLContextService | SSL Context Service provides trusted certificates and client certificates for TLS communication. | |
Connection Timeout * | Connection Timeout | 5 secs | Maximum time to wait for initial socket connection to the HTTP URL. | |
Socket Read Timeout * | Socket Read Timeout | 15 secs | Maximum time to wait for receiving responses from a socket connection to the HTTP URL. | |
Socket Write Timeout * | Socket Write Timeout | 15 secs | Maximum time to wait for write operations while sending requests from a socket connection to the HTTP URL. | |
Socket Idle Timeout * | Socket Idle Timeout | 5 mins | Maximum time to wait before closing idle connections to the HTTP URL. | |
Socket Idle Connections * | Socket Idle Connections | 5 | Maximum number of idle connections to the HTTP URL. | |
Proxy Configuration Service | proxy-configuration-service | Controller Service: ProxyConfigurationService Implementations: StandardProxyConfigurationService | Specifies the Proxy Configuration Controller Service to proxy network requests. Supported proxies: HTTP + AuthN, SOCKS In case of SOCKS, it is not guaranteed that the selected SOCKS Version will be used by the processor. | |
Request OAuth2 Access Token Provider | Request OAuth2 Access Token Provider | Controller Service: OAuth2AccessTokenProvider Implementations: StandardOauth2AccessTokenProvider | Enables managed retrieval of OAuth2 Bearer Token applied to HTTP requests using the Authorization Header. | |
Request Username | Request Username | The username provided for authentication of HTTP requests. Encoded using Base64 for HTTP Basic Authentication as described in RFC 7617. | ||
Request Password | Request Password | The password provided for authentication of HTTP requests. Encoded using Base64 for HTTP Basic Authentication as described in RFC 7617. | ||
Request Digest Authentication Enabled | Request Digest Authentication Enabled | false |
| Enable Digest Authentication on HTTP requests with Username and Password credentials as described in RFC 7616. This property is only considered if:
|
Request Failure Penalization Enabled | Request Failure Penalization Enabled | false |
| Enable penalization of request FlowFiles when receiving HTTP response with a status code between 400 and 499. |
Request Body Enabled | Request Body Enabled | true |
| Enable sending HTTP request body for PATCH, POST, or PUT methods. This property is only considered if:
|
Request Multipart Form-Data Name | Request Multipart Form-Data Name | Enable sending HTTP request body formatted using multipart/form-data and using the form name configured. Supports Expression Language, using FlowFile attributes and Environment variables. This property is only considered if:
| ||
Request Multipart Form-Data Filename Enabled | Request Multipart Form-Data Filename Enabled | true |
| Enable sending the FlowFile filename attribute as the filename parameter in the Content-Disposition Header for multipart/form-data HTTP requests. This property is only considered if:
|
Request Chunked Transfer-Encoding Enabled * | Request Chunked Transfer-Encoding Enabled | false |
| Enable sending HTTP requests with the Transfer-Encoding Header set to chunked, and disable sending the Content-Length Header. Transfer-Encoding applies to the body in HTTP/1.1 requests as described in RFC 7230 Section 3.3.1 This property is only considered if:
|
Request Content-Encoding * | Request Content-Encoding | DISABLED |
| HTTP Content-Encoding applied to request body during transmission. The receiving server must support the selected encoding to avoid request failures. This property is only considered if:
|
Request Content-Type * | Request Content-Type | ${mime.type} | HTTP Content-Type Header applied to when sending an HTTP request body for PATCH, POST, or PUT methods. The Content-Type defaults to application/octet-stream when not configured. Supports Expression Language, using FlowFile attributes and Environment variables. This property is only considered if:
| |
Request Date Header Enabled * | Request Date Header Enabled | True |
| Enable sending HTTP Date Header on HTTP requests as described in RFC 7231 Section 7.1.1.2. |
Request Header Attributes Pattern | Request Header Attributes Pattern | Regular expression that defines which FlowFile attributes to send as HTTP headers in the request. If not defined, no attributes are sent as headers. Dynamic properties will be always be sent as headers. The dynamic property name will be the header key and the dynamic property value, interpreted as Expression Language, will be the header value. Attributes and their values are limited to ASCII characters due to the requirement of the HTTP protocol. | ||
Request User-Agent | Request User-Agent | HTTP User-Agent Header applied to requests. RFC 7231 Section 5.5.3 describes recommend formatting. Supports Expression Language, using FlowFile attributes and Environment variables. | ||
Response Body Attribute Name | Response Body Attribute Name | FlowFile attribute name used to write an HTTP response body for FlowFiles transferred to the Original relationship. Supports Expression Language, using FlowFile attributes and Environment variables. | ||
Response Body Attribute Size | Response Body Attribute Size | 256 | Maximum size in bytes applied when writing an HTTP response body to a FlowFile attribute. Attributes exceeding the maximum will be truncated. This property is only considered if:
| |
Response Body Ignored * | Response Body Ignored | false |
| Disable writing HTTP response FlowFiles to Response relationship |
Response Cache Enabled * | Response Cache Enabled | false |
| Enable HTTP response caching described in RFC 7234. Caching responses considers ETag and other headers. |
Response Cache Size * | Response Cache Size | 10MB | Maximum size of HTTP response cache in bytes. Caching responses considers ETag and other headers. This property is only considered if:
| |
Response Cookie Strategy * | Response Cookie Strategy | DISABLED |
| Strategy for accepting and persisting HTTP cookies. Accepting cookies enables persistence across multiple requests. |
Response Generation Required | Response Generation Required | false |
| Enable generation and transfer of a FlowFile to the Response relationship regardless of HTTP response received. |
Response FlowFile Naming Strategy * | Response FlowFile Naming Strategy | RANDOM |
| Determines the strategy used for setting the filename attribute of FlowFiles transferred to the Response relationship. |
Response Header Request Attributes Enabled | Response Header Request Attributes Enabled | false |
| Enable adding HTTP response headers as attributes to FlowFiles transferred to the Original relationship. |
Response Redirects Enabled * | Response Redirects Enabled | True |
| Enable following HTTP redirects sent with HTTP 300 series responses as described in RFC 7231 Section 6.4. |
Dynamic Properties
Name | Value | Description |
---|---|---|
Header Name | Attribute Expression Language | Send request header with a key matching the Dynamic Property Key and a value created by evaluating the Attribute Expression Language set in the value of the Dynamic Property. Supports Expression Language: Yes, evaluated using FlowFile Attributes and Environment variables. |
post:form:<NAME> | Attribute Expression Language | When the HTTP Method is POST, dynamic properties with the property name in the form of post:form:<NAME>, where the <NAME> will be the form data name, will be used to fill out the multipart form parts. If send message body is false, the flowfile will not be sent, but any other form data will be. Supports Expression Language: Yes, evaluated using FlowFile Attributes and Environment variables. |
Relationships
Name | Description |
---|---|
Failure | Request FlowFiles transferred when receiving socket communication errors. |
No Retry | Request FlowFiles transferred when receiving HTTP responses with a status code between 400 an 499. |
Original | Request FlowFiles transferred when receiving HTTP responses with a status code between 200 and 299. |
Response | Response FlowFiles transferred when receiving HTTP responses with a status code between 200 and 299. |
Retry | Request FlowFiles transferred when receiving HTTP responses with a status code between 500 and 599. |
Reads Attributes
This processor does not read attributes.
Writes Attributes
Name | Description |
---|---|
invokehttp.java.exception.class | The Java exception class raised when the processor fails |
invokehttp.java.exception.message | The Java exception message raised when the processor fails |
invokehttp.remote.dn | The DN of the remote server |
invokehttp.request.duration | Duration (in milliseconds) of the HTTP call to the external endpoint |
invokehttp.request.url | The original request URL |
invokehttp.response.body | In the instance where the status code received is not a success (2xx) then the response body will be put to the 'invokehttp.response.body' attribute of the request FlowFile. |
invokehttp.response.url | The URL that was ultimately requested after any redirects were followed |
invokehttp.status.code | The status code that is returned |
invokehttp.status.message | The status message that is returned |
invokehttp.tx.id | The transaction ID that is returned after reading the response |
user-defined | If the 'Put Response Body In Attribute' property is set then whatever it is set to will become the attribute key and the value would be the body of the HTTP response. |
State Management
This component does not store state.
Restricted
This component is not restricted.
Input Requirement
This component allows an incoming relationship.
System Resource Considerations
This component does not specify system resource considerations.