InvokeHTTP

Description:

An HTTP client processor which can interact with a configurable HTTP Endpoint. The destination URL and HTTP Method are configurable. FlowFile attributes are converted to HTTP headers and the FlowFile contents are included as the body of the request (if the HTTP Method is PUT, POST or PATCH).

Tags:

http, https, rest, client

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, whether a property supports the NiFi Expression Language, and whether a property is considered "sensitive", meaning that its value will be encrypted. Before entering a value in a sensitive property, ensure that the nifi.properties file has an entry for the property nifi.sensitive.props.key.

NameDefault ValueAllowable ValuesDescription
HTTP MethodGETHTTP 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: true (will be evaluated using flow file attributes and variable registry)
Remote URLRemote URL which will be connected to, including scheme, host, port, path.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
SSL Context ServiceController Service API:
SSLContextService
Implementations: StandardSSLContextService
StandardRestrictedSSLContextService
The SSL Context Service used to provide client certificate information for TLS/SSL (https) connections. It is also used to connect to HTTPS Proxy.
Connection Timeout5 secsMax wait time for connection to remote service.
Read Timeout15 secsMax wait time for response from remote service.
Idle Timeout5 minsMax idle time before closing connection to the remote service.
Max Idle Connections5Max number of idle connections to keep open.
Include Date HeaderTrue
  • True
  • False
Include an RFC-2616 Date header in the request.
Follow RedirectsTrue
  • True
  • False
Follow HTTP redirects issued by remote server.
Cookie StrategyDISABLED
  • DISABLED
  • ACCEPT_ALL
Strategy for accepting and persisting HTTP cookies. Accepting cookies enables persistence across multiple requests.
Disable HTTP/2False
  • True
  • False
Determines whether or not to disable use of the HTTP/2 protocol version. If disabled, only HTTP/1.1 is supported.
FlowFile Naming StrategyRANDOM
  • RANDOM FlowFile filename attribute will be a random value.
  • URL_PATH FlowFile filename attribute will be extracted from the remote URL path. The attribute may contain URL encoded characters. If the path doesn't exist, the attribute will be a random value.
Determines the strategy used for setting the filename attribute of the FlowFile.
Attributes to SendRegular expression that defines which attributes to send as HTTP headers in the request. If not defined, no attributes are sent as headers. Also any dynamic properties set will be sent as headers. The dynamic property key will be the header key and the dynamic property value will be interpreted as expression language will be the header value.
UseragentThe Useragent identifier sent along with each request
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Basic Authentication UsernameThe username to be used by the client to authenticate against the Remote URL. Cannot include control characters (0-31), ':', or DEL (127).
Basic Authentication PasswordThe password to be used by the client to authenticate against the Remote URL.
Sensitive Property: true
OAuth2 Access Token providerController Service API:
OAuth2AccessTokenProvider
Implementation: StandardOauth2AccessTokenProvider
No Description Provided.
Proxy Configuration ServiceController Service API:
ProxyConfigurationService
Implementation: StandardProxyConfigurationService
Specifies the Proxy Configuration Controller Service to proxy network requests. If set, it supersedes proxy settings configured per component. Supported proxies: HTTP + AuthN, SOCKS
Proxy HostThe fully qualified hostname or IP address of the proxy server
Supports Expression Language: true (will be evaluated using variable registry only)
Proxy PortThe port of the proxy server
Supports Expression Language: true (will be evaluated using variable registry only)
Proxy TypehttpThe type of the proxy we are connecting to. Must be either http or https
Supports Expression Language: true (will be evaluated using variable registry only)
Proxy UsernameUsername to set when authenticating against proxy
Supports Expression Language: true (will be evaluated using variable registry only)
Proxy PasswordPassword to set when authenticating against proxy
Sensitive Property: true
Supports Expression Language: true (will be evaluated using variable registry only)
Put Response Body In AttributeIf set, the response body received back will be put into an attribute of the original FlowFile instead of a separate FlowFile. The attribute key to put to is determined by evaluating value of this property.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Max Length To Put In Attribute256If routing the response body to an attribute of the original (by setting the "Put response body in attribute" property or by receiving an error status code), the number of characters put to the attribute value will be at most this amount. This is important because attributes are held in memory and large attributes will quickly cause out of memory issues. If the output goes longer than this value, it will be truncated to fit. Consider making this smaller if able.
Use Digest Authenticationfalse
  • true
  • false
Whether to communicate with the website using Digest Authentication. 'Basic Authentication Username' and 'Basic Authentication Password' are used for authentication.
Always Output Responsefalse
  • true
  • false
Will force a response FlowFile to be generated and routed to the 'Response' relationship regardless of what the server status code received is or if the processor is configured to put the server response body in the request attribute. In the later configuration a request FlowFile with the response body in the attribute and a typical response FlowFile will be emitted to their respective relationships.
Add Response Headers to Requestfalse
  • true
  • false
Enabling this property saves all the response headers to the original request. This may be when the response headers are needed but a response is not generated due to the status code received.
Content-Type${mime.type}The Content-Type to specify for when content is being transmitted through a PUT, POST or PATCH. In the case of an empty value after evaluating an expression language expression, Content-Type defaults to application/octet-stream
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Send Message Bodytrue
  • true
  • false
If true, sends the HTTP message body on POST/PUT/PATCH requests (default). If false, suppresses the message body and content-type header for these requests.
Use Chunked Encodingfalse
  • true
  • false
When POST'ing, PUT'ing or PATCH'ing content set this property to true in order to not pass the 'Content-length' header and instead send 'Transfer-Encoding' with a value of 'chunked'. This will enable the data transfer mechanism which was introduced in HTTP 1.1 to pass data of unknown lengths in chunks.
Penalize on "No Retry"false
  • true
  • false
Enabling this property will penalize FlowFiles that are routed to the "No Retry" relationship.
Use HTTP ETagfalse
  • true
  • false
Enable HTTP entity tag (ETag) support for HTTP requests.
Maximum ETag Cache Size10MBThe maximum size that the ETag cache should be allowed to grow to. The default size is 10MB.
Ignore response's contentfalse
  • true
  • false
If true, the processor will not write the response's content into the flow file.
FlowFile Form Data NameWhen Send Message Body is true, and FlowFile Form Data Name is set, the FlowFile will be sent as the message body in multipart/form format with this value as the form data name.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Set FlowFile Form Data File Nametrue
  • true
  • false
When Send Message Body is true, FlowFile Form Data Name is set, and Set FlowFile Form Data File Name is true, the FlowFile's fileName value will be set as the filename property of the form data.

Dynamic Properties:

Dynamic Properties allow the user to specify both the name and value of a property.

NameValueDescription
Header NameAttribute Expression LanguageSend 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: true (will be evaluated using flow file attributes and variable registry)
post:form:<NAME>Attribute Expression LanguageWhen 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: true (will be evaluated using flow file attributes and variable registry)

Relationships:

NameDescription
OriginalThe original FlowFile will be routed upon success (2xx status codes). It will have new attributes detailing the success of the request.
FailureThe original FlowFile will be routed on any type of connection failure, timeout or general exception. It will have new attributes detailing the request.
RetryThe original FlowFile will be routed on any status code that can be retried (5xx status codes). It will have new attributes detailing the request.
No RetryThe original FlowFile will be routed on any status code that should NOT be retried (1xx, 3xx, 4xx status codes). It will have new attributes detailing the request.
ResponseA Response FlowFile will be routed upon success (2xx status codes). If the 'Output Response Regardless' property is true then the response will be sent to this relationship regardless of the status code received.

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
invokehttp.status.codeThe status code that is returned
invokehttp.status.messageThe status message that is returned
invokehttp.response.bodyIn 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.request.urlThe original request URL
invokehttp.request.durationDuration (in milliseconds) of the HTTP call to the external endpoint
invokehttp.response.urlThe URL that was ultimately requested after any redirects were followed
invokehttp.tx.idThe transaction ID that is returned after reading the response
invokehttp.remote.dnThe DN of the remote server
invokehttp.java.exception.classThe Java exception class raised when the processor fails
invokehttp.java.exception.messageThe Java exception message raised when the processor fails
user-definedIf 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:

None specified.