Operator HTTPRequest
- Method POST: If the parameter requestBodyAttribute or requestBodyAttributeBin is defined and the value of the attribute is not empty, the value of the attribute is copied into the request body. Otherwise the names and values of the Request Attributes are used to generate the request form.
- Other Methods: If the parameter requestBodyAttribute or requestBodyAttributeBin is defined, the value of the attribute is copied into the request body.
- If parameter requestUrlArgumentsAttribute is specified and this attribute is not empty, the value of this attribute is copied as URL argument string and overwrites all other arguments. (all methods)
- In method GET: If parameter requestAttributesAsUrlArguments is true, all Request Attribute names and values are converted to URL query parameters.
GET
An HTTP GET request is made. If parameter requestAttributesAsUrlArguments is true, all request attributes are converted to URL query parameters. If parameter requestUrlArgumentsAttribute is specified and this attribute is not empty, this attribute is copied as URL argument string and overwrites all other arguments.
POST
An HTTP POST request is made, any request attributes are set as the body of the request message if parameter requestBodyAttribute and requestBodyAttributeBin is not present or the value of the attribute is empty. The encoding of the request body takes the content type into account. If content type is application/json, a json body is generated from request attributes. If content type is application/x-www-form-urlencoded, a url-encoded body is generated from request attributes. For all other content types, the content of all request attributes is concatenated into the message body. If requestBodyAttribute or requestBodyAttributeBin attribute is not empty, the body of the request is copied from one of these attribute instead. If content type equals application/octet-stream, attribute requestBodyAttributeBin is taken.
PUT
An HTTP PUT request is made, the body of the request message is copied from requestBodyAttribute or requestBodyAttributeBin attribute, depending on the content type.
PATCH
An HTTP PATCH request is made, the body of the request message is copied from requestBodyAttribute or requestBodyAttributeBin attribute, depending on the content type.
OPTIONS
No message body is generated.
HEAD
An HTTP HEAD request is made.
DELETE
No message body is generated.
TRACE
No message body is generated.
NONE
No http request is generated but an output tuple is submitted if the output port is present and attributes are passed from input port to output port.
Request Attributes
- Any attribute specified by parameters url, method, contentType, requestBodyAttribute, requestBodyAttributeBin or equestUrlArguments.
- If parameter requestAttributes is set, all attributes of this parameter are considered a request attribute.
- If parameter requestAttributes has one empty element, no attributes are considered a request attribute.
Http Authentication
The operator supports the following authentication methods: Basic, Digest, OAuth1a and OAuth2.0; see parameter authenticationType.
Behavior in a consistent region
This operator cannot be used inside a consistent region.
Summary
- Ports
- This operator has 1 input port and 1 output port.
- Windowing
- This operator does not accept any windowing configurations.
- Parameters
- This operator supports 43 parameters.
Optional: accessTokenAttribute, authenticationFile, authenticationProperties, authenticationType, connectionTimeout, contentType, disableAutomaticRetries, disableContentCompression, disableRedirectHandling, errorDiagnostics, extraHeaderAttribute, extraHeaders, fixedContentType, fixedMethod, fixedUrl, method, outputBody, outputBodyRaw, outputCharSet, outputContentEncoding, outputContentType, outputDataLine, outputHeader, outputStatus, outputStatusCode, proxy, proxyPort, redirectStrategy, requestAttributes, requestAttributesAsUrlArguments, requestBodyAttribute, requestBodyAttributeBin, requestUrlArgumentsAttribute, socketTimeout, sslAcceptAllCertificates, sslKeyPassword, sslKeyStoreFile, sslKeyStorePassword, sslTrustStoreFile, sslTrustStorePassword, tokenTypeAttribute, url, userAgent
- Metrics
- This operator reports 3 metrics.
Properties
- Implementation
- Java
- Ports (0)
-
This stream contains the information sent in a http request. Each tuple with valid request data results in an HTTP request except if method NONE is specified.
- Properties
-
- Optional: false
- ControlPort: false
- WindowingMode: NonWindowed
- WindowPunctuationInputMode: Oblivious
- Assignments
- Java operators do not support output assignments.
- Ports (0)
-
Data received in the http response be sent on this port. Other attributes are assigned from input stream.
- Properties
-
- Optional: true
- WindowPunctuationOutputMode: Preserving
Optional: accessTokenAttribute, authenticationFile, authenticationProperties, authenticationType, connectionTimeout, contentType, disableAutomaticRetries, disableContentCompression, disableRedirectHandling, errorDiagnostics, extraHeaderAttribute, extraHeaders, fixedContentType, fixedMethod, fixedUrl, method, outputBody, outputBodyRaw, outputCharSet, outputContentEncoding, outputContentType, outputDataLine, outputHeader, outputStatus, outputStatusCode, proxy, proxyPort, redirectStrategy, requestAttributes, requestAttributesAsUrlArguments, requestBodyAttribute, requestBodyAttributeBin, requestUrlArgumentsAttribute, socketTimeout, sslAcceptAllCertificates, sslKeyPassword, sslKeyStoreFile, sslKeyStorePassword, sslTrustStoreFile, sslTrustStorePassword, tokenTypeAttribute, url, userAgent
- accessTokenAttribute
-
Attribute that specifies the access token if authenticationType is OAUTH2. Any value of this attribute overwrites the value of the accessToken property in authenticationFile or in authenticationProperties. This parameter is meaningless if the authenticationType is different from OAUTH2
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- ExpressionMode: Attribute
- authenticationFile
-
Path to the properties file containing authentication information. Authentication file is recommended to be stored in the application_dir/etc directory. Path of this file can be absolute or relative, if relative path is specified then it is relative to the application directory. The content of this file depends on the authenticationType.
- If authenticationType is STANDARD: A valid line is composed from the authentication Scope (hostname or ANY_HOST, equal sign, user, colon, password. E.g.: ANY_HOST=user:passwd
- If authenticationType is OAUTH1: The authentication file must contain key/value pairs for the keys: consumerKey, consumerSecret, accessToken and accessTokenSecret.
- If authenticationType is OAUTH2: The authentication file must contain one key/value pair for key accessToken=myAccessToken.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- authenticationProperties
-
Properties to override those in the authentication file.
- authenticationType
-
The type of used authentication method. Valid options are "STANDARD", "OAUTH1," and "OAUTH2". Default is "STANDARD". If "STANDARD" is selected, the authorization may be none, basic or digest authorization. If the server requires basic or digest authorization one of the parameters authenticationFile or authenticationProperties is required. If the "OAUTH1" option is selected, the requests will be singed using OAuth 1.0a If the "OAUTH2" option is selected, the requests will be singed using OAuth 2.0.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- connectionTimeout
-
Set the connection timeout in milliseconds. If value is 0, the default connection timeout is used. (You cannot specify a connection timeout that increases the platform default (130sec.); you can only use it to decrease the platform default. Default is 0.
- Properties
-
- Type: int32
- Cardinality: 1
- Optional: true
- contentType
-
MIME content type of entity for POST and PUT requests. Only one of contentType and fixedContentType must be specified. Defaults to application/json.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- ExpressionMode: Attribute
- disableAutomaticRetries
-
Disables automatic request recovery and re-execution. Default is false
- Properties
-
- Type: boolean
- Cardinality: 1
- Optional: true
- disableContentCompression
-
Disables automatic content decompression. Default is false
- Properties
-
- Type: boolean
- Cardinality: 1
- Optional: true
- disableRedirectHandling
-
Disables automatic redirect handling. Default is false. This parameter must not be used together with parameter redirectStrategy
- Properties
-
- Type: boolean
- Cardinality: 1
- Optional: true
- errorDiagnostics
-
Name of the attribute to populate the error diagnostics with. This string contains the diagnostics information when the program execution of the http operation throws an exception. This string is empty when a http response was received. The status line of the http response is issued in the dataStatus attribute.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- extraHeaderAttribute
-
One extra header to send with the request, the attribute must contain a string in the form Header-Name: value. If the attribute value is an empty string, no additional header is send. This parameter may be applied together with parameter extraHeaders.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- ExpressionMode: Attribute
- extraHeaders
-
Extra headers to send with request, format is Header-Name: value.
- fixedContentType
-
Fixed MIME content type of entity for POST and PUT requests. Only one of contentType and fixedContentType must be specified. Defaults to application/json.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- fixedMethod
-
Fixed method for each HTTP request. Every HTTP request uses the method provided. One and only one of method and fixedMethod must be specified.
- Properties
-
- Type: com.teracloud.streams.inet.http.HTTPMethod (OPTIONS, GET, HEAD, POST, PUT, PATCH, DELETE, TRACE, NONE)
- Cardinality: 1
- Optional: true
- ExpressionMode: CustomLiteral
- fixedUrl
-
Fixed URL to send HTTP requests to. Any tuple received on the input port results in a request to the URL provided (except for method NONE). One and only one of url and fixedUrl must be specified.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- method
-
Attribute that specifies the method to be used in the HTTP request for a tuple. One and only one of method and fixedMethod must be specified.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- ExpressionMode: Attribute
- outputBody
-
Name of the attribute to populate the response body with. If this parameter is set, the operators returns one tuple for each request. Only one of outputDataLine and outputBody must be specified. This parameter is not allowed if the operator has no output port.If this parameter is set and parameter outputBodyRaw is set, all responses with entitiy mime type not equal to application/octet-stream or default/binary generate output here.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- outputBodyRaw
-
Name of the attribute to populate the raw response body with. The type of this attribute must be blob. Only one of outputDataLine and outputBodyRaw must be specified. This parameter is not allowed if the operator has no output port. You may use outputBodyRaw and outputBody.If this parameter is set and parameter outputBody is set, all responses with entitiy mime type equal to application/octet-stream or default/binary will generate output here.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- outputCharSet
-
Name of the attribute to populate the response entity charset with. This parameter is not allowed if the operator has no output port.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- outputContentEncoding
-
Name of the attribute to populate the response content encoding header with. This parameter is not allowed if the operator has no output port.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- outputContentType
-
Name of the attribute to populate the response entity mime type with. This parameter is not allowed if the operator has no output port.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- outputDataLine
-
Name of the attribute to populate one line of the response data with. If this parameter is set, the operators returns one tuple for each line in the response body but at least one tuple if the body is empty. Only one of outputDataLine and outputBody must be specified. This parameter is not allowed if the operator has no output port.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- outputHeader
-
Name of the attribute to populate the response header information with. The type of this attribute must be string list. This parameter is not allowed if the operator has no output port.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- outputStatus
-
Name of the attribute to populate the response status line with. This parameter is not allowed if the operator has no output port.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- outputStatusCode
-
Name of the attribute to populate the response status code as integer with. The type of this attribute must be int32. This is the numerical value from the http response or -1 if no response was received. This parameter is not allowed if the operator has no output port.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- proxy
-
Hostname of the http-proxy to be used. If this parameter is omitted no proxy is used.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- proxyPort
-
The proxy-port to be used. Default value is 8080. This parameter is ignored if no proxy parameter is specified.
- Properties
-
- Type: int32
- Cardinality: 1
- Optional: true
- redirectStrategy
-
Set the redirection strategy. Possible values are:
- DEFAULT: This enables the automatic redirect handling. This strategy honors the restrictions on automatic redirection of entity enclosing methods such as POST and PUT imposed by the HTTP specification. 302 Moved Temporarily, 301 Moved Permanently and 307 Temporary Redirect status codes will result in an automatic redirect of HEAD and GET methods only. POST and PUT methods will not be automatically redirected as requiring user confirmation.
- LAX: This relaxes the default settings and enables the automatic redirection of all HEAD, GET, POST, and DELETE requests.
- NONE: This disables the automatic redirection handling.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- requestAttributes
-
Names of the attributes which are part of the request body. The content of these attributes is sent as request body in method POST. If parameter requestAttributesAsUrlArguments is true, the request attributes are additionally appended as arguments to the url in method GET. If this parameter is missing, all attributes, excluding those that are used to specify the URL, method, content type, Request url arguments, extra header, access token, token type or request body, are used in the request body. One empty element defines an empty list which means no attributes are considered request attributes.
- requestAttributesAsUrlArguments
-
If this parameter is true, the request attributes are appended as arguments to the url in method GET. If this parameter is false, the request attributes are not appended to the url. Default is false. These arguments are overwritten from a non-empty value in parameter requestUrlArgumentsAttribute.
- Properties
-
- Type: boolean
- Cardinality: 1
- Optional: true
- requestBodyAttribute
-
Request body attribute for any method that accepts an entity (PUT / POST / PATCH). In method PUT and PATCH the body of request is taken from this attribute. In method POST, any non-empty value overwrites the request attributes.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- ExpressionMode: Attribute
- requestBodyAttributeBin
-
Request body attribute for any method that accepts an entity (PUT / POST / PATCH). In method PUT and PATCH the body of request is taken from this attribute. In method POST, any non-empty value overwrites the request attributes. The content of this attribue is used when the content type equals application/octet-stream. In all other cases, the content of the requestBodyAttribute is used. Note: The input attribute must be of type blob.
- Properties
-
- Cardinality: 1
- Optional: true
- ExpressionMode: Attribute
- requestUrlArgumentsAttribute
-
Request url arguments attribute. If this parameter is set and the value of this attribute is not empty, the content of this string is appended as arguments to the request url. This overwrites the arguments which are generated from the request attributes. The value is expected to be unescaped and may contain non-ASCII characters
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- ExpressionMode: Attribute
- socketTimeout
-
Set the socket timeout in milliseconds, which is the timeout for waiting for data (request-response cycle). A timeout value of zero is interpreted as an infinite timeout. A negative value is interpreted as system default. Default is -1.
- Properties
-
- Type: int32
- Cardinality: 1
- Optional: true
- sslAcceptAllCertificates
-
Accept all SSL certificates, this means the server certificate is not checked. If this parameter is set, parameter sslTrustStoreFile and setSslKeyStoreFile are not allowed. Setting this option will allow potentially insecure connections. Default is false.
- Properties
-
- Type: boolean
- Cardinality: 1
- Optional: true
- sslKeyPassword
-
Password for the keys in the key store.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- sslKeyStoreFile
-
Path to jks key store file used for client authentication. This store should contain one client key pair.If this parameter is set, parameter sslKeyStorePassword is optional.If this parameter is set, parameter sslKeyPassword is required.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- sslKeyStorePassword
-
Password for the key store. If the password for the store differs from the key password, use this parameter.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- sslTrustStoreFile
-
Path to jks trust store file used for server authentication. Self signed certificates will be accepted.If this parameter is set, parameter sslTrustStorePassword is optional.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- sslTrustStorePassword
-
Password for the trust store.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- tokenTypeAttribute
-
Attribute that specifies the access token type if authenticationType is OAUTH2. Any value of this attribute overwrites the value of the authMethod property in authenticationFile or in authenticationProperties. This parameter is meaningless if the authenticationType is different from OAUTH2
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- ExpressionMode: Attribute
- url
-
Attribute that specifies the URL to be used in the HTTP request for a tuple. One and only one of url and fixedUrl must be specified.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- ExpressionMode: Attribute
- userAgent
-
Assigns the header User-Agent value. Default is "Apache-HttpClient/4.5.12 (Java/1.8.0_231)"
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- Operator class library