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:

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, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
HTTP MethodHTTP 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)
HTTP URLRemote URLHTTP 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: true (will be evaluated using flow file attributes and variable registry)
HTTP/2 Disableddisable-http2False
  • True
  • 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 ServiceSSL Context ServiceController Service API:
SSLContextService
Implementations: StandardSSLContextService
StandardRestrictedSSLContextService
SSL Context Service provides trusted certificates and client certificates for TLS communication.
Socket Connect TimeoutConnection Timeout5 secsMaximum time to wait for initial socket connection to the HTTP URL.
Socket Read TimeoutRead Timeout15 secsMaximum time to wait for receiving responses from a socket connection to the HTTP URL.
Socket Write TimeoutSocket Write Timeout15 secsMaximum time to wait for write operations while sending requests from a socket connection to the HTTP URL.
Socket Idle Timeoutidle-timeout5 minsMaximum time to wait before closing idle connections to the HTTP URL.
Socket Idle Connectionsmax-idle-connections5Maximum number of idle connections to the HTTP URL.
Proxy Configuration Serviceproxy-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: SOCKS, HTTP + AuthN In case of SOCKS, it is not guaranteed that the selected SOCKS Version will be used by the processor.
Proxy HostProxy HostProxy Host and dependent properties are deprecated in favor of Proxy Configuration Service. Proxy Host can be configured using an IP address or DNS address.
Supports Expression Language: true (will be evaluated using variable registry only)
Proxy PortProxy PortProxy Port and dependent properties are deprecated in favor of Proxy Configuration Service. Port number for the configured Proxy Host address.
Supports Expression Language: true (will be evaluated using variable registry only)

This Property is only considered if the [Proxy Host] Property has a value specified.
Proxy TypeProxy TypehttpProxy Type and dependent properties are deprecated in favor of Proxy Configuration Service. Proxy protocol type is not used
Supports Expression Language: true (will be evaluated using variable registry only)

This Property is only considered if the [Proxy Host] Property has a value specified.
Proxy Usernameinvokehttp-proxy-userProxy Username and dependent properties are deprecated in favor of Proxy Configuration Service. Username to set when authenticating with a Proxy server.
Supports Expression Language: true (will be evaluated using variable registry only)

This Property is only considered if the [Proxy Host] Property has a value specified.
Proxy Passwordinvokehttp-proxy-passwordProxy Password and dependent properties are deprecated in favor of Proxy Configuration Service. Password to set when authenticating with a Proxy server.
Sensitive Property: true
Supports Expression Language: true (will be evaluated using variable registry only)

This Property is only considered if the [Proxy Host] Property has a value specified.
Request OAuth2 Access Token Provideroauth2-access-token-providerController Service API:
OAuth2AccessTokenProvider
Implementation: StandardOauth2AccessTokenProvider
Enables managed retrieval of OAuth2 Bearer Token applied to HTTP requests using the Authorization Header.
Request UsernameBasic Authentication UsernameThe username provided for authentication of HTTP requests. Encoded using Base64 for HTTP Basic Authentication as described in RFC 7617.
Request PasswordBasic Authentication PasswordThe password provided for authentication of HTTP requests. Encoded using Base64 for HTTP Basic Authentication as described in RFC 7617.
Sensitive Property: true
Request Digest Authentication EnabledDigest Authenticationfalse
  • true
  • false
Enable Digest Authentication on HTTP requests with Username and Password credentials as described in RFC 7616.

This Property is only considered if the [Request Username] Property has a value specified.
Request Failure Penalization EnabledPenalize on "No Retry"false
  • true
  • false
Enable penalization of request FlowFiles when receiving HTTP response with a status code between 400 and 499.
Request Body Enabledsend-message-bodytrue
  • true
  • false
Enable sending HTTP request body for PATCH, POST, or PUT methods.

This Property is only considered if the [HTTP Method] Property is set to one of the following values: [POST], [PATCH], [PUT]
Request Multipart Form-Data Nameform-body-form-nameEnable sending HTTP request body formatted using multipart/form-data and using the form name configured.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)

This Property is only considered if the [Request Body Enabled] Property has a value of "true".
Request Multipart Form-Data Filename Enabledset-form-filenametrue
  • true
  • false
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 the [Request Multipart Form-Data Name] Property has a value specified.
Request Chunked Transfer-Encoding EnabledUse Chunked Encodingfalse
  • true
  • 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 the [HTTP Method] Property is set to one of the following values: [POST], [PATCH], [PUT]
Request Content-EncodingContent-EncodingDISABLED
  • DISABLED Content encoding not applied during transmission
  • GZIP Gzip content encoding and HTTP Content-Encoding header applied during transmission
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 the [HTTP Method] Property is set to one of the following values: [POST], [PATCH], [PUT]
Request Content-TypeContent-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: true (will be evaluated using flow file attributes and variable registry)

This Property is only considered if the [HTTP Method] Property is set to one of the following values: [POST], [PATCH], [PUT]
Request Date Header EnabledInclude Date HeaderTrue
  • True
  • False
Enable sending HTTP Date Header on HTTP requests as described in RFC 7231 Section 7.1.1.2.
Request Header Attributes PatternAttributes to SendRegular 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-AgentUseragentHTTP User-Agent Header applied to requests. RFC 7231 Section 5.5.3 describes recommend formatting.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Response Body Attribute NamePut Response Body In AttributeFlowFile attribute name used to write an HTTP response body for FlowFiles transferred to the Original relationship.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Response Body Attribute SizeMax Length To Put In Attribute256Maximum 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 the [Response Body Attribute Name] Property has a value specified.
Response Body Ignoredignore-response-contentfalse
  • true
  • false
Disable writing HTTP response FlowFiles to Response relationship
Response Cache Enableduse-etagfalse
  • true
  • false
Enable HTTP response caching described in RFC 7234. Caching responses considers ETag and other headers.
Response Cache Sizeetag-max-cache-size10MBMaximum size of HTTP response cache in bytes. Caching responses considers ETag and other headers.

This Property is only considered if the [Response Cache Enabled] Property has a value of "true".
Response Cookie Strategycookie-strategyDISABLED
  • DISABLED
  • ACCEPT_ALL
Strategy for accepting and persisting HTTP cookies. Accepting cookies enables persistence across multiple requests.
Response Generation RequiredAlways Output Responsefalse
  • true
  • false
Enable generation and transfer of a FlowFile to the Response relationship regardless of HTTP response received.
Response FlowFile Naming Strategyflow-file-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 FlowFiles transferred to the Response relationship.
Response Header Request Attributes EnabledAdd Response Headers to Requestfalse
  • true
  • false
Enable adding HTTP response headers as attributes to FlowFiles transferred to the Original relationship.
Response Redirects EnabledFollow RedirectsTrue
  • True
  • False
Enable following HTTP redirects sent with HTTP 300 series responses as described in RFC 7231 Section 6.4.

Dynamic Properties:

Supports Sensitive Dynamic Properties: Yes

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
OriginalRequest FlowFiles transferred when receiving HTTP responses with a status code between 200 and 299.
FailureRequest FlowFiles transferred when receiving socket communication errors.
RetryRequest FlowFiles transferred when receiving HTTP responses with a status code between 500 and 599.
No RetryRequest FlowFiles transferred when receiving HTTP responses with a status code between 400 an 499.
ResponseResponse FlowFiles transferred when receiving HTTP responses with a status code between 200 and 299.

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.