blob: 9695f8398adae2192499ad8624e34c64c6b118c4 [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></meta><title>HandleHttpRequest</title><link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"></link></head><script type="text/javascript">window.onload = function(){if(self==top) { document.getElementById('nameHeader').style.display = "inherit"; } }</script><body><h1 id="nameHeader" style="display: none;">HandleHttpRequest</h1><h2>Description: </h2><p>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.</p><p><a href="additionalDetails.html">Additional Details...</a></p><h3>Tags: </h3><p>http, https, request, listen, ingress, web service</p><h3>Properties: </h3><p>In the list below, the names of required properties appear in <strong>bold</strong>. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the <a href="../../../../../html/expression-language-guide.html">NiFi Expression Language</a>.</p><table id="properties"><tr><th>Display Name</th><th>API Name</th><th>Default Value</th><th>Allowable Values</th><th>Description</th></tr><tr><td id="name"><strong>Listening Port</strong></td><td>Listening Port</td><td id="default-value">80</td><td id="allowable-values"></td><td id="description">The Port to listen on for incoming HTTP requests<br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr><tr><td id="name">Hostname</td><td>Hostname</td><td></td><td id="allowable-values"></td><td id="description">The Hostname to bind to. If not specified, will bind to all hosts</td></tr><tr><td id="name">SSL Context Service</td><td>SSL Context Service</td><td></td><td id="allowable-values"><strong>Controller Service API: </strong><br/>RestrictedSSLContextService<br/><strong>Implementation: </strong><a href="../../../nifi-ssl-context-service-nar/1.19.1/org.apache.nifi.ssl.StandardRestrictedSSLContextService/index.html">StandardRestrictedSSLContextService</a></td><td id="description">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</td></tr><tr><td id="name"><strong>HTTP Protocols</strong></td><td>HTTP Protocols</td><td id="default-value">http/1.1</td><td id="allowable-values"><ul><li>http/1.1 <img src="../../../../../html/images/iconInfo.png" alt="HTTP/1.1" title="HTTP/1.1"></img></li><li>h2 http/1.1 <img src="../../../../../html/images/iconInfo.png" alt="HTTP/2 and HTTP/1.1 negotiated based on requested protocols" title="HTTP/2 and HTTP/1.1 negotiated based on requested protocols"></img></li><li>h2 <img src="../../../../../html/images/iconInfo.png" alt="HTTP/2" title="HTTP/2"></img></li></ul></td><td id="description">HTTP Protocols supported for Application Layer Protocol Negotiation with TLS<br/><br/><strong>This Property is only considered if </strong><strong>the [SSL Context Service] Property has a value specified.</strong></td></tr><tr><td id="name"><strong>HTTP Context Map</strong></td><td>HTTP Context Map</td><td></td><td id="allowable-values"><strong>Controller Service API: </strong><br/>HttpContextMap<br/><strong>Implementation: </strong><a href="../../../nifi-http-context-map-nar/1.19.1/org.apache.nifi.http.StandardHttpContextMap/index.html">StandardHttpContextMap</a></td><td id="description">The HTTP Context Map Controller Service to use for caching the HTTP Request Information</td></tr><tr><td id="name">Allowed Paths</td><td>Allowed Paths</td><td></td><td id="allowable-values"></td><td id="description">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</td></tr><tr><td id="name"><strong>Default URL Character Set</strong></td><td>Default URL Character Set</td><td id="default-value">UTF-8</td><td id="allowable-values"></td><td id="description">The character set to use for decoding URL parameters if the HTTP Request does not supply one</td></tr><tr><td id="name"><strong>Allow GET</strong></td><td>Allow GET</td><td id="default-value">true</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">Allow HTTP GET Method</td></tr><tr><td id="name"><strong>Allow POST</strong></td><td>Allow POST</td><td id="default-value">true</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">Allow HTTP POST Method</td></tr><tr><td id="name"><strong>Allow PUT</strong></td><td>Allow PUT</td><td id="default-value">true</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">Allow HTTP PUT Method</td></tr><tr><td id="name"><strong>Allow DELETE</strong></td><td>Allow DELETE</td><td id="default-value">true</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">Allow HTTP DELETE Method</td></tr><tr><td id="name"><strong>Allow HEAD</strong></td><td>Allow HEAD</td><td id="default-value">false</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">Allow HTTP HEAD Method</td></tr><tr><td id="name"><strong>Allow OPTIONS</strong></td><td>Allow OPTIONS</td><td id="default-value">false</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">Allow HTTP OPTIONS Method</td></tr><tr><td id="name"><strong>Maximum Threads</strong></td><td>Maximum Threads</td><td id="default-value">200</td><td id="allowable-values"></td><td id="description">The maximum number of threads that the embedded HTTP server will use for handling requests.</td></tr><tr><td id="name">Additional HTTP Methods</td><td>Additional HTTP Methods</td><td></td><td id="allowable-values"></td><td id="description">A comma-separated list of non-standard HTTP Methods that should be allowed</td></tr><tr><td id="name"><strong>Client Authentication</strong></td><td>Client Authentication</td><td id="default-value">No Authentication</td><td id="allowable-values"><ul><li>No Authentication <img src="../../../../../html/images/iconInfo.png" alt="Processor will not authenticate clients. Anyone can communicate with this Processor anonymously" title="Processor will not authenticate clients. Anyone can communicate with this Processor anonymously"></img></li><li>Want Authentication <img src="../../../../../html/images/iconInfo.png" alt="Processor will try to verify the client but if unable to verify will allow the client to communicate anonymously" title="Processor will try to verify the client but if unable to verify will allow the client to communicate anonymously"></img></li><li>Need Authentication <img src="../../../../../html/images/iconInfo.png" alt="Processor will reject communications from any client unless the client provides a certificate that is trusted by the TrustStorespecified in the SSL Context Service" title="Processor will reject communications from any client unless the client provides a certificate that is trusted by the TrustStorespecified in the SSL Context Service"></img></li></ul></td><td id="description">Specifies whether or not the Processor should authenticate clients. This value is ignored if the &lt;SSL Context Service&gt; Property is not specified or the SSL Context provided uses only a KeyStore and not a TrustStore.</td></tr><tr><td id="name"><strong>Container Queue Size</strong></td><td>container-queue-size</td><td id="default-value">50</td><td id="allowable-values"></td><td id="description">The size of the queue for Http Request Containers</td></tr><tr><td id="name"><strong>Multipart Request Max Size</strong></td><td>multipart-request-max-size</td><td id="default-value">1 MB</td><td id="allowable-values"></td><td id="description">The 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</td></tr><tr><td id="name"><strong>Multipart Read Buffer Size</strong></td><td>multipart-read-buffer-size</td><td id="default-value">512 KB</td><td id="allowable-values"></td><td id="description">The 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.</td></tr><tr><td id="name">Parameters to Attributes List</td><td>parameters-to-attributes</td><td></td><td id="allowable-values"></td><td id="description">A comma-separated list of HTTP parameters or form data to output as attributes</td></tr></table><h3>Relationships: </h3><table id="relationships"><tr><th>Name</th><th>Description</th></tr><tr><td>success</td><td>All content that is received is routed to the 'success' relationship</td></tr></table><h3>Reads Attributes: </h3>None specified.<h3>Writes Attributes: </h3><table id="writes-attributes"><tr><th>Name</th><th>Description</th></tr><tr><td>http.context.identifier</td><td>An identifier that allows the HandleHttpRequest and HandleHttpResponse to coordinate which FlowFile belongs to which HTTP Request/Response.</td></tr><tr><td>mime.type</td><td>The MIME Type of the data, according to the HTTP Header "Content-Type"</td></tr><tr><td>http.servlet.path</td><td>The part of the request URL that is considered the Servlet Path</td></tr><tr><td>http.context.path</td><td>The part of the request URL that is considered to be the Context Path</td></tr><tr><td>http.method</td><td>The HTTP Method that was used for the request, such as GET or POST</td></tr><tr><td>http.local.name</td><td>IP address/hostname of the server</td></tr><tr><td>http.server.port</td><td>Listening port of the server</td></tr><tr><td>http.query.string</td><td>The query string portion of the Request URL</td></tr><tr><td>http.remote.host</td><td>The hostname of the requestor</td></tr><tr><td>http.remote.addr</td><td>The hostname:port combination of the requestor</td></tr><tr><td>http.remote.user</td><td>The username of the requestor</td></tr><tr><td>http.protocol</td><td>The protocol used to communicate</td></tr><tr><td>http.request.uri</td><td>The full Request URL</td></tr><tr><td>http.auth.type</td><td>The type of HTTP Authorization used</td></tr><tr><td>http.principal.name</td><td>The name of the authenticated user making the request</td></tr><tr><td>http.query.param.XXX</td><td>Each of query parameters in the request will be added as an attribute, prefixed with "http.query.param."</td></tr><tr><td>http.param.XXX</td><td>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.</td></tr><tr><td>http.subject.dn</td><td>The Distinguished Name of the requestor. This value will not be populated unless the Processor is configured to use an SSLContext Service</td></tr><tr><td>http.issuer.dn</td><td>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</td></tr><tr><td>http.headers.XXX</td><td>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"</td></tr><tr><td>http.headers.multipart.XXX</td><td>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"</td></tr><tr><td>http.multipart.size</td><td>For requests with Content-Type "multipart/form-data", the part's content size is recorded into this attribute</td></tr><tr><td>http.multipart.content.type</td><td>For requests with Content-Type "multipart/form-data", the part's content type is recorded into this attribute</td></tr><tr><td>http.multipart.name</td><td>For requests with Content-Type "multipart/form-data", the part's name is recorded into this attribute</td></tr><tr><td>http.multipart.filename</td><td>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)</td></tr><tr><td>http.multipart.fragments.sequence.number</td><td>For requests with Content-Type "multipart/form-data", the part's index is recorded into this attribute. The index starts with 1.</td></tr><tr><td>http.multipart.fragments.total.number</td><td>For requests with Content-Type "multipart/form-data", the count of all parts is recorded into this attribute.</td></tr></table><h3>State management: </h3>This component does not store state.<h3>Restricted: </h3>This component is not restricted.<h3>Input requirement: </h3>This component does not allow an incoming relationship.<h3>System Resource Considerations:</h3>None specified.<h3>See Also:</h3><p><a href="../org.apache.nifi.processors.standard.HandleHttpResponse/index.html">HandleHttpResponse</a></p></body></html>