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
Tags:
HTTP, HTTPS, request, listen, ingress, web service
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.
Name | Default Value | Allowable Values | Description |
Listening Port | 80 | The Port to listen on for incoming HTTP requests | |
Hostname | The Hostname to bind to. If not specified, will bind to all hosts | ||
SSL Context Service |
Controller Service API: SSLContextService Implementation: StandardSSLContextService |
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 Context Map |
Controller Service API: HttpContextMap Implementation: StandardHttpContextMap |
The HTTP Context Map Controller Service to use for caching the HTTP Request Information | |
Allowed Paths | A 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 | UTF-8 | The character set to use for decoding URL parameters if the HTTP Request does not supply one | |
Allow GET | true |
* true * false |
Allow HTTP GET Method |
Allow POST | true |
* true * false |
Allow HTTP POST Method |
Allow PUT | true |
* true * false |
Allow HTTP PUT Method |
Allow DELETE | true |
* true * false |
Allow HTTP DELETE Method |
Allow HEAD | false |
* true * false |
Allow HTTP HEAD Method |
Allow OPTIONS | false |
* true * false |
Allow HTTP OPTIONS Method |
Additional HTTP Methods | A comma-separated list of non-standard HTTP Methods that should be allowed | ||
Client Authentication | No 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. |
Relationships:
Name | Description |
success | All content that is received is routed to the 'success' relationship |
Reads Attributes:
None specified.
Writes Attributes:
Name | Description |
http.context.identifier | An identifier that allows the HandleHttpRequest and HandleHttpResponse to coordinate which FlowFile belongs to which HTTP Request/Response. |
mime.type | The MIME Type of the data, according to the HTTP Header "Content-Type" |
http.servlet.path | The part of the request URL that is considered the Servlet Path |
http.context.path | The part of the request URL that is considered to be the Context Path |
http.method | The HTTP Method that was used for the request, such as GET or POST |
http.query.string | The query string portion of hte Request URL |
http.remote.host | The hostname of the requestor |
http.remote.addr | The hostname:port combination of the requestor |
http.remote.user | The username of the requestor |
http.request.uri | The full Request URL |
http.auth.type | The type of HTTP Authorization used |
http.principal.name | The name of the authenticated user making the request |
http.subject.dn | The Distinguished Name of the requestor. This value will not be populated unless the Processor is configured to use an SSLContext Service |
http.issuer.dn | The 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.headers.XXX | Each 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" |
See Also:
HandleHttpResponse,StandardSSLContextService
Usage Description:
The pairing of this Processor with a HandleHttpResponse Processor provides the ability to use NiFi to visually construct a web server that can carry out any functionality that is available through the existing Processors. For example, one could construct a Web-based front end to an SFTP Server by constructing a flow such as:
HandleHttpRequest -> PutSFTP -> HandleHttpResponse
The HandleHttpRequest Processor provides several Properties to configure which methods are supported, the paths that are supported, and SSL configuration.