public class HttpClientAction extends Object
| Constructor and Description |
|---|
HttpClientAction() |
| Modifier and Type | Method and Description |
|---|---|
Map<String,String> |
execute(String url,
String tlsVersion,
String allowedCyphers,
String authType,
String preemptiveAuth,
String username,
String password,
String kerberosConfFile,
String kerberosLoginConfFile,
String kerberosSkipPortForLookup,
String proxyHost,
String proxyPort,
String proxyUsername,
String proxyPassword,
String trustAllRoots,
String x509HostnameVerifier,
String trustKeystore,
String trustPassword,
String keystore,
String keystorePassword,
String connectTimeout,
String socketTimeout,
String useCookies,
String keepAlive,
String connectionsMaxPerRoot,
String connectionsMaxTotal,
String headers,
String responseCharacterSet,
String destinationFile,
String followRedirects,
String queryParams,
String queryParamsAreURLEncoded,
String queryParamsAreFormEncoded,
String formParams,
String formParamsAreURLEncoded,
String sourceFile,
String body,
String contentType,
String requestCharacterSet,
String multipartBodies,
String multipartBodiesContentType,
String multipartFiles,
String multipartFilesContentType,
String multipartValuesAreURLEncoded,
String chunkedRequestEntity,
String method,
com.hp.oo.sdk.content.plugin.SerializableSessionObject httpClientCookieSession,
com.hp.oo.sdk.content.plugin.GlobalSessionObject httpClientPoolingConnectionManager)
This operation does an http request and a parsing of the response.
|
public Map<String,String> execute(String url, String tlsVersion, String allowedCyphers, String authType, String preemptiveAuth, String username, String password, String kerberosConfFile, String kerberosLoginConfFile, String kerberosSkipPortForLookup, String proxyHost, String proxyPort, String proxyUsername, String proxyPassword, String trustAllRoots, String x509HostnameVerifier, String trustKeystore, String trustPassword, String keystore, String keystorePassword, String connectTimeout, String socketTimeout, String useCookies, String keepAlive, String connectionsMaxPerRoot, String connectionsMaxTotal, String headers, String responseCharacterSet, String destinationFile, String followRedirects, String queryParams, String queryParamsAreURLEncoded, String queryParamsAreFormEncoded, String formParams, String formParamsAreURLEncoded, String sourceFile, String body, String contentType, String requestCharacterSet, String multipartBodies, String multipartBodiesContentType, String multipartFiles, String multipartFilesContentType, String multipartValuesAreURLEncoded, String chunkedRequestEntity, String method, com.hp.oo.sdk.content.plugin.SerializableSessionObject httpClientCookieSession, com.hp.oo.sdk.content.plugin.GlobalSessionObject httpClientPoolingConnectionManager)
url - The web address to make the request to. This must be a standard URL as specified in RFC 3986. This is a required input.
authType - The type of authentication used by this operation when trying to execute the request on the target server.
The authentication is not preemptive: a plain request not including authentication info
will be made and only when the server responds with a 'WWW-Authenticate' header the client will
send required headers. If the server needs no authentication but you specify one in this input
the request will work nevertheless. Then client cannot choose the authentication method and there
is no fallback so you have to know which one you need. If the web application and proxy use
different authentication types, these must be specified like in the Example model.
preemptiveAuth - If this field is 'true' authentication info will be sent in the first request.
If this is 'false' a request with no authentication info will be made and if server responds
with 401 and a header like WWW-Authenticate: Basic realm="myRealm" only then the authentication
info will be sent. Default value: true. Valid values: true, falseusername - The user name used for authentication. For NTLM authentication, the required format is 'domain\\user'
and if you only specify the 'user' it will append a dot like '.\\user' so that a local user on the
target machine can be used. In order for all authentication schemes to work (except Kerberos) username is required.password - The password used for authentication.kerberosConfFile - A krb5.conf file with content similar to the one in the examples
(where you replace CONTOSO.COM with your domain and 'ad.contoso.com' with your kdc FQDN).
This configures the Kerberos mechanism required by the Java GSS-API methods.
kerberosLoginConfFile - A login.conf file needed by the JAAS framework with the content similar to the one in examples
Format: http://docs.oracle.com/javase/7/docs/jre/api/security/jaas/spec/com/sun/security/auth/module/Krb5LoginModule.htmlkerberosSkipPortForLookup - Do not include port in the key distribution center database lookup. Default value: true. Valid values: true, falseproxyHost - The proxy server used to access the web site.proxyPort - The proxy server port. Default value: 8080. Valid values: -1 and integer values greater than 0.
The value '-1' indicates that the proxy port is not set and the scheme default port will be used.
If the scheme is 'http://' and the 'proxyPort' is set to '-1' then port '80' will be used.proxyUsername - The user name used when connecting to the proxy. The 'authType' input will be used to choose authentication type.
The 'Basic' and 'Digest' proxy authentication types are supported.proxyPassword - The proxy server password associated with the proxyUsername input value.trustAllRoots - Specifies whether to enable weak security over SSL/TSL. A certificate is trusted even if no trusted
certification authority issued it. Default value: false. Valid values: true, falsex509HostnameVerifier - Specifies the way the server hostname must match a domain name in the subject's Common Name (CN)
or subjectAltName field of the X.509 certificate. Set this to "allow_all" to skip any checking.
For the value "browser_compatible" the hostname verifier works the same way as Curl and Firefox.
The hostname must match either the first CN, or any of the subject-alts.
A wildcard can occur in the CN, and in any of the subject-alts. The only difference
between "browser_compatible" and "strict" is that a wildcard (such as "*.foo.com")
with "browser_compatible" matches all subdomains, including "a.b.foo.com".
Default value: strict. Valid values: strict,browser_compatible,allow_alltrustKeystore - The pathname of the Java TrustStore file. This contains certificates from other parties
that you expect to communicate with, or from Certificate Authorities that you trust to
identify other parties. If the protocol (specified by the 'url') is not 'https' or if
trustAllRoots is 'true' this input is ignored. Default value: trustPassword - The password associated with the TrustStore file. If trustAllRoots is false and trustKeystore is empty,
trustPassword default will be supplied. Default value: changeitkeystore - The pathname of the Java KeyStore file. You only need this if the server requires client authentication.
If the protocol (specified by the 'url') is not 'https' or if trustAllRoots is 'true' this input is ignored.
keystorePassword - The password associated with the KeyStore file. If trustAllRoots is false and keystore
is empty, keystorePassword default will be supplied. Default value: changeitconnectTimeout - The time to wait for a connection to be established, in seconds.
A timeout value of '0' represents an infinite timeout. Default value: 0socketTimeout - The timeout for waiting for data (a maximum period inactivity between two consecutive data packets),
in seconds. A socketTimeout value of '0' represents an infinite timeout. Default value: 0.useCookies - Specifies whether to enable cookie tracking or not. Cookies are stored between consecutive calls
in a serializable session object therefore they will be available on a branch level.
If you specify a non-boolean value, the default value is used. Default value: true. Valid values: true, falsekeepAlive - Specifies whether to create a shared connection that will be used in subsequent calls.
If keepAlive is false, the already open connection will be used and after execution it will close it.
The operation will use a connection pool stored in a GlobalSessionObject that will be available throughout
the execution (the flow and subflows, between parallel split lanes). Default value: true. Valid values: true, false.connectionsMaxPerRoot - The maximum limit of connections on a per route basis.
The default will create no more than 2 concurrent connections per given route. Default value: 2connectionsMaxTotal - The maximum limit of connections in total.
The default will create no more than 2 concurrent connections in total. Default value: 20headers - The list containing the headers to use for the request separated by new line (CRLF).
The header name - value pair will be separated by ":". Format: According to HTTP standard for headers (RFC 2616).
Examples: Accept:text/plainresponseCharacterSet - The character encoding to be used for the HTTP response.
If responseCharacterSet is empty, the charset from the 'Content-Type' HTTP response header will be used.
If responseCharacterSet is empty and the charset from the HTTP response Content-Type header is empty,
the default value will be used. You should not use this for method=HEAD or OPTIONS. Default value: ISO-8859-1destinationFile - The absolute path of a file on disk where to save the entity returned by the response.
'returnResult' will no longer be populated with the entity if this is specified.
You should not use this for method=HEAD or OPTIONS. Example: C:\temp\destinationFile.txtfollowRedirects - Specifies whether the HTTP client automatically follows redirects.
Redirects explicitly prohibited by the HTTP specification as requiring user intervention
will not be followed (redirects on POST and PUT requests that are converted to GET requests).
If you specify a non-boolean value, the default value is used. Default value: true. Valid values: true, falsequeryParams - The list containing query parameters to append to the URL. The names and the values must not
be URL encoded unless you specify "queryParamsAreURLEncoded"=true because if they are encoded
and "queryParamsAreURLEncoded"=false they will get double encoded.
The separator between name-value pairs is "&". The query name will be separated from query
value by "=". Note that you need to URL encode at least "&" to "%26" and "=" to "%3D" and
set "queryParamsAreURLEncoded"="true" if you leave the other special URL characters un-encoded
they will be encoded by the HTTP Client. Examples: parameterName1=parameterValue1¶meterName2=parameterValue2;queryParamsAreURLEncoded - Specifies whether to encode (according to the url encoding standard) the queryParams.
If you set "queryParamsAreURLEncoded"=true and you have invalid characters in 'queryParams'
they will get encoded anyway. If "queryParamsAreURLEncoded"=false all characters will be encoded.
But the ' ' (space) character will be encoded as + if queryParamsAreURLEncoded is either true or false.
Also %20 will be encoded as + if "queryParamsAreURLEncoded"=true.
If you specify a non-boolean value, the default value is used.
Default value: false. Valid values: true, falsequeryParamsAreFormEncoded - Specifies whether to encode the queryParams in the form request format or not.
This format is the default format used by the apache http client library.
If queryParamsAreFormEncoded=true then all characters will be encoded based on the queryParamsAreURLEncoded
input. If queryParamsAreFormEncoded=false all reserved characters are not encoded no matter of
queryParamsAreURLEncoded input. The only exceptions are for ' ' (space) character which is encoded as %20 in both
cases of queryParamsAreURLEncoded input and + (plus) which is encoded as %20 if queryParamsAreURLEncoded=true
and not encoded if queryParamsAreURLEncoded=false. If the special characters are already encoded
and queryParamsAreURLEncoded=true then they will be transformed into their original format.
For example: %40 will be @, %2B will be +. But %20 (space) will not be transformed.
The list of reserved chars is: ;/?:@&=+,$
Default value: true. Valid values: true, false
Example: query=test te%20@st will be encoded in query=test%20te%20@stformParams - This input needs to be given in form encoded format and will set the entity to be sent in the request.
It will also set the content-type to application/x-www-form-urlencoded.
This should only be used with method=POST. Note that you need to URL encode at
least "&" to "%26" and "=" to "%3D" and set "queryParamsAreURLEncoded"="true" if you leave the
other special URL characters un-encoded they will be encoded by the HTTP Client.
formParamsAreURLEncoded - formParams will be encoding (according to the url encoding standard) if this is 'true'.
If you set "formParamsAreURLEncoded"=true and you have invalid characters in 'formParams'
they will get encoded anyway. This should only be used with method=POST.
Default value: false. Valid values: true, falsesourceFile - The absolute path of a file on disk from where to read the entity for the http request.
This will be read using 'requestCharacterSet' or 'contentType' input (see below).
This should not be provided for method=GET, HEAD, TRACE. Examples: C:\temp\sourceFile.txtbody - The string to include in body for HTTP POST operation. If both sourceFile and body will be provided,
the body input has priority over sourceFile. This should not be provided for method=GET, HEAD, TRACEcontentType - The content type that should be set in the request header, representing the MIME-type of the
data in the message body. Default value: text/plain. Examples: "text/html", "application/x-www-form-urlencoded"requestCharacterSet - The character encoding to be used for the HTTP request body.
If contentType is empty, the requestCharacterSet will use the default value.
If contentType will include charset (ex.: "application/json; charset=UTF-8"),
the requestCharacterSet value will overwrite the charset value from contentType input.
This should not be provided for method=GET, HEAD, TRACE. Default value: ISO-8859-1multipartBodies - This is a name=textValue list of pairs separated by "&". This will also take into account
the "contentType" and "charset" inputs. The request entity will be like:
multipartBodiesContentType - Each entity from the multipart entity has a content-type header.
You can only specify it once for all the parts and it is the only way to change
the characterSet of the encoding. Default value: text/plain; charset=ISO-8859-1
Examples: text/plain; charset=UTF-8multipartFiles - This is a list of name=filePath pairs. This will also take into account the "contentType"
and "charset" inputs. The request entity will be like:
multipartFilesContentType - Each entity from the multipart entity has a content-type header. You can only specify it once for all parts.
Default value: application/octet-stream. Examples: image/png,text/plainmultipartValuesAreURLEncoded - You need to set this to 'true' if the bodies may contain the "&" and "="
separators and you also need to URL encode them so that "&" becomes %26 and "=" becomes %3D
(using the URL Encoder operation on each value or by a simple replace). Default value: falsechunkedRequestEntity - Data is sent in a series of "chunks". It uses the Transfer-Encoding HTTP header in place
of the Content-Length header.Generally it is recommended to let HttpClient choose the
most appropriate transfer encoding based on the properties of the HTTP message being transferred.
It is possible, however, to inform HttpClient that chunk coding is preferred by setting this input to "true".
Please note that HttpClient will use this flag as a hint only.
This value will be ignored when using HTTP protocol versions that do not support chunk coding, such as HTTP/1.0.
This setting is ignored for multipart post entities.method - The HTTP method used. This is a required input.httpClientCookieSession - the session object that holds the cookies if the useCookies input is true.httpClientPoolingConnectionManager - the GlobalSessionObject that holds the http client pooling connection manager.Copyright © 2020. All rights reserved.