HandleHttpRequest 2.0.0

Bundle
org.apache.nifi | nifi-standard-nar
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
Input Requirement
FORBIDDEN
Supports Sensitive Dynamic Properties
false
  • Additional Details for HandleHttpRequest 2.0.0

    HandleHttpRequest

    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.

    To handle requests with Content-Type: multipart/form-data containing multiple parts, additional attention needs to be paid. Each part generates a FlowFile of its own. To each these FlowFiles, some special attributes are written:

    • http.context.identifier
    • http.multipart.fragments.sequence.number
    • http.multipart.fragments.total.number

    These attributes could be used to implement a gating mechanism for HandleHttpResponse processor to wait for the processing of FlowFiles with sequence number http.multipart.fragments.sequence.number until up to * http.multipart.fragments.total.number* of flow files are processed, belonging to the same http.context.identifier, which is unique to the request.

Properties
Relationships
Name Description
success All content that is received is routed to the 'success' relationship
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.local.name IP address/hostname of the server
http.server.port Listening port of the server
http.query.string The query string portion of the 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.protocol The protocol used to communicate
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.query.param.XXX Each of query parameters in the request will be added as an attribute, prefixed with "http.query.param."
http.param.XXX Form 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.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.certificate.sans.N.name X.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.nameType X.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.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"
http.headers.multipart.XXX Each 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.multipart.size For requests with Content-Type "multipart/form-data", the part's content size is recorded into this attribute
http.multipart.content.type For requests with Content-Type "multipart/form-data", the part's content type is recorded into this attribute
http.multipart.name For requests with Content-Type "multipart/form-data", the part's name is recorded into this attribute
http.multipart.filename For 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.number For 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.number For requests with Content-Type "multipart/form-data", the count of all parts is recorded into this attribute.
See Also