Skip to main content

HandleHttpRequest

Description

Starts an HTTP Server and listens for HTTP Requests. For each request, creates a FlowFile and transfers to 'success'. This Processor is designed to be used in conjunction with the HandleHttpResponse Processor in order to create a Web Service. In case of a multipart request, one FlowFile is generated for each part.

Tags

http, https, ingress, listen, request, web service

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 NameAPI NameDefault ValueAllowable ValuesDescription
Listening Port *Listening Port80The Port to listen on for incoming HTTP requests

Supports Expression Language, using Environment variables.
HostnameHostnameThe Hostname to bind to. If not specified, will bind to all hosts
SSL Context ServiceSSL Context ServiceController Service:
RestrictedSSLContextService

Implementations:
StandardRestrictedSSLContextService
The SSL Context Service to use in order to secure the server. If specified, the server will accept only HTTPS requests; otherwise, the server will accept only HTTP requests
HTTP Protocols *HTTP Protocolshttp/1.1
  • http/1.1
  • h2 http/1.1
  • h2
HTTP Protocols supported for Application Layer Protocol Negotiation with TLS

This property is only considered if:
  • the property SSL Context Service has a value specified
HTTP Context Map *HTTP Context MapController Service:
HttpContextMap

Implementations:
StandardHttpContextMap
The HTTP Context Map Controller Service to use for caching the HTTP Request Information
Allowed PathsAllowed PathsA Regular Expression that specifies the valid HTTP Paths that are allowed in the incoming URL Requests. If this value is specified and the path of the HTTP Requests does not match this Regular Expression, the Processor will respond with a 404: NotFound
Default URL Character Set *Default URL Character SetUTF-8The character set to use for decoding URL parameters if the HTTP Request does not supply one
Allow GET *Allow GETtrue
  • true
  • false
Allow HTTP GET Method
Allow POST *Allow POSTtrue
  • true
  • false
Allow HTTP POST Method
Allow PUT *Allow PUTtrue
  • true
  • false
Allow HTTP PUT Method
Allow DELETE *Allow DELETEtrue
  • true
  • false
Allow HTTP DELETE Method
Allow HEAD *Allow HEADfalse
  • true
  • false
Allow HTTP HEAD Method
Allow OPTIONS *Allow OPTIONSfalse
  • true
  • false
Allow HTTP OPTIONS Method
Maximum Threads *Maximum Threads200The maximum number of threads that the embedded HTTP server will use for handling requests.
Request Header Maximum Size *Request Header Maximum Size8 KBThe maximum supported size of HTTP headers in requests sent to this processor
Additional HTTP MethodsAdditional HTTP MethodsA comma-separated list of non-standard HTTP Methods that should be allowed
Client Authentication *Client AuthenticationNo Authentication
  • No Authentication
  • Want Authentication
  • Need Authentication
Specifies whether or not the Processor should authenticate clients. This value is ignored if the <SSL Context Service> Property is not specified or the SSL Context provided uses only a KeyStore and not a TrustStore.
Container Queue Size *container-queue-size50The size of the queue for Http Request Containers
Multipart Request Max Size *multipart-request-max-size1 MBThe max size of the request. Only applies for requests with Content-Type: multipart/form-data, and is used to prevent denial of service type of attacks, to prevent filling up the heap or disk space
Multipart Read Buffer Size *multipart-read-buffer-size512 KBThe threshold size, at which the contents of an incoming file would be written to disk. Only applies for requests with Content-Type: multipart/form-data. It is used to prevent denial of service type of attacks, to prevent filling up the heap or disk space.
Parameters to Attributes Listparameters-to-attributesA comma-separated list of HTTP parameters or form data to output as attributes

Dynamic Properties

This component does not support dynamic properties.

Relationships

NameDescription
successAll content that is received is routed to the 'success' relationship

Reads Attributes

This processor does not read attributes.

Writes Attributes

NameDescription
http.auth.typeThe type of HTTP Authorization used
http.certificate.sans.N.nameX.509 Client Certificate Subject Alternative Name value from mutual TLS authentication. The attribute name has a zero-based index ordered according to the content of Client Certificate
http.certificate.sans.N.nameTypeX.509 Client Certificate Subject Alternative Name type from mutual TLS authentication. The attribute name has a zero-based index ordered according to the content of Client Certificate. The attribute value is one of the General Names from RFC 3280 Section 4.1.2.7
http.context.identifierAn identifier that allows the HandleHttpRequest and HandleHttpResponse to coordinate which FlowFile belongs to which HTTP Request/Response.
http.context.pathThe part of the request URL that is considered to be the Context Path
http.headers.XXXEach of the HTTP Headers that is received in the request will be added as an attribute, prefixed with "http.headers." For example, if the request contains an HTTP Header named "x-my-header", then the value will be added to an attribute named "http.headers.x-my-header"
http.headers.multipart.XXXEach of the HTTP Headers that is received in the multipart request will be added as an attribute, prefixed with "http.headers.multipart." For example, if the multipart request contains an HTTP Header named "content-disposition", then the value will be added to an attribute named "http.headers.multipart.content-disposition"
http.issuer.dnThe Distinguished Name of the entity that issued the Subject's certificate. This value will not be populated unless the Processor is configured to use an SSLContext Service
http.local.nameIP address/hostname of the server
http.methodThe HTTP Method that was used for the request, such as GET or POST
http.multipart.content.typeFor requests with Content-Type "multipart/form-data", the part's content type is recorded into this attribute
http.multipart.filenameFor requests with Content-Type "multipart/form-data", when the part contains an uploaded file, the name of the file is recorded into this attribute. Files are stored temporarily at the default temporary-file directory specified in "java.io.File" Java Docs)
http.multipart.fragments.sequence.numberFor requests with Content-Type "multipart/form-data", the part's index is recorded into this attribute. The index starts with 1.
http.multipart.fragments.total.numberFor requests with Content-Type "multipart/form-data", the count of all parts is recorded into this attribute.
http.multipart.nameFor requests with Content-Type "multipart/form-data", the part's name is recorded into this attribute
http.multipart.sizeFor requests with Content-Type "multipart/form-data", the part's content size is recorded into this attribute
http.param.XXXForm parameters in the request that are configured by "Parameters to Attributes List" will be added as an attribute, prefixed with "http.param.". Putting form parameters of large size is not recommended.
http.principal.nameThe name of the authenticated user making the request
http.protocolThe protocol used to communicate
http.query.param.XXXEach of query parameters in the request will be added as an attribute, prefixed with "http.query.param."
http.query.stringThe query string portion of the Request URL
http.remote.addrThe hostname:port combination of the requestor
http.remote.hostThe hostname of the requestor
http.remote.userThe username of the requestor
http.request.uriThe full Request URL
http.server.portListening port of the server
http.servlet.pathThe part of the request URL that is considered the Servlet Path
http.subject.dnThe Distinguished Name of the requestor. This value will not be populated unless the Processor is configured to use an SSLContext Service
mime.typeThe MIME Type of the data, according to the HTTP Header "Content-Type"

State Management

This component does not store state.

Restricted

This component is not restricted.

Input Requirement

This component does not allow an incoming relationship.

System Resource Considerations

This component does not specify system resource considerations.

See Also

HandleHttpResponse