httpopsPost
The httpopsPost operation is an APIScript operation that is used to make HTTP POST requests.
Input Parameters
You can use api:set to specify the operation's input parameters, as shown below.
<api:set attr="url" value="http://www.example.com/target" />
Required Parameters
- URL: The URL to retrieve.
HTTP
- Method: The HTTP Method. Valid values are POST,PUT, and PATCH. Default is POST.
- ContentType: The content type for the post. Default is application/x-www-form-urlencoded
- PostData: Data to include in the post. Use file:// followed by a file path to post the contents of a file. Default is empty
- FormEncoding: When encoding paramname# and paramvalue#, the format to use. Valid values are URLENCODED and FORMDATA. Default is URLENCODED
- Header:Name#: The name for each custom header to pass with the request.
- Header:Value#: The value for each custom header to pass with the request.
- ParamName#: The name for each parameter to pass with the request.
- ParamValue#: The value for each parameter to pass with the request.
- Cookie:*: Any cookies that should be added to the request.
- Timeout: The timeout, in seconds, for the operation to complete. Zero (0) means no timeout. The default value is 60.
- Logfile: The file where exchanged/transferred data is logged.
- Verbosity: The detail level to use when logging the exchanged/transferred data to the file specified by the logfile input.
Authentication
- User: The username to authenticate with if the authscheme parameter is set to something other than None.
- Password: The password to authenticate with if the authscheme parameter is set to something other than None.
- AuthScheme: The authorization mechanism to use. Only relevant if user and password are provided. Valid values are BASIC, DIGEST, and NTLM. Default is BASIC.
- KerberosKDC: The KDC setting of Kerberos, available when AuthScheme is NEGOTIATE.
- KerberosRealm: The Realm setting of Kerberos, available when AuthScheme is NEGOTIATE.
OAuth
- Version: The OAuth version. Use OAuth to authorize the request. The allowed values are DISABLED, 1.0, 2.0. The default value is DISABLED.
- Token: The access token for OAuth.
- Token_Secret: The access token secret. OAuth 1.0 only.
- Client_Id: The OAuth client Id. OAuth 1.0 only.
- Client_Secret: The OAuth client secret. OAuth 1.0 only.
- Sign_Method: The signature method used to calculate the signature for OAuth 1.0. The allowed values are HMAC-SHA1, PLAINTEXT. The default value is HMAC-SHA1.
Proxy
- Proxy_Auto: Whether or not the proxy should be detected from Windows system settings. This takes precedence over other proxy settings and is not available in Java. Source is proxy_auto. The allowed values are TRUE, FALSE. The default value is FALSE.
- Proxy_Server: IP address or host name of the proxy server used for the request. Source is proxy_server.
- Proxy_Port: The port number of the proxy server. Source is proxy_port.
- Proxy_User: The user Id used to authenticate with the proxy server. Source is proxy_user.
- Proxy_Password: The password used to authenticate with the proxy server. Source is proxy_password.
- Proxy_AuthScheme: The authentication scheme of the proxy server. Valid values are BASIC, DIGEST, NONE, NTLM, and NEGOTIATE. Default is BASIC.
- Proxy_AuthToken: The proxy authentication token.
- Proxy_SSLType: The SSL type of the proxy server. The allowed values are AUTO, ALWAYS, NEVER, TUNNEL. The default value is AUTO.
Firewall
- Firewall_Server: The IP address or host name of the firewall. Source is firewall_host.
- Firewall_Port: The port number of the firewall. Source is firewall_port.
- Firewall_User: The user Id used to authenticate with the firewall. Source is firewall_user.
- Firewall_Password: The password used to authenticate with the firewall. Source is firewall_password.
- Firewall_Type: The type of the firewall. Source is firewall_type. Valid values are NONE, TUNNEL, SOCKS4,and SOCKS5. Default is NONE.
Other
- Internalconfig#: Sets an internal configuration setting.'/>
- Charset: The charset of the exchanged/transferred data. Default is UTF-8' />
- HTTPVersion: Version of the HTTP protocol to use. Valid values are 1.0 and 1.1. Default is 1.1
- FollowRedirects: Whether or not to follow HTTP redirects. Valid values are TRUE and FALSE. Default is TRUE.
- SSLCert: The SSL certificate to be accepted from the server. Any other certificate will be rejected. This can take the form of a full PEM certificate, the path to a file containing the certificate, the public key, the MD5 thumbprint, or the SHA-1 thumbprint. If not specified any valid certificate will be accepted. Default is TRUSTED
- SSLClientCert: The name of the certificate store for the client certificate.
- SSLClientCertType: The store type of the client certificate. Valid values are USER,MACHINE,PFXFILE,PFXBLOB,JKSFILE,JKSBLOB,PEMKEY_FILE,PEMKEY_BLOB,PUBLIC_KEY_FILE,PUBLIC_KEY_BLOB,SSHPUBLIC_KEY_BLOB,P7BFILE,P7BBLOB,SSHPUBLIC_KEY_FILE,PPKFILE,PPKBLOB,XMLFILE,and XMLBLOB
- SSLClientCertPassword: The password of the client certificate.
- SSLClientCertSubject: The subject of the client certificate. Using an asterisk will find the first certificate in the store.
Output Parameters
- ssl:issuer: The issuer of the SSL certificate.
- ssl:subject: The subject of the SSL certificate.
- statuscode: The HTTP status code returned from the request.
- content: The content of the HTTP response.
- cookie:*: The cookies returned with the response.
- allcookies: All of the cookies from the response, returned as a single string.
- header:*: The headers returned with the response.
Example:
<api:set attr="URL" value="http://www.example.com/target">
<api:set attr="method" value="POST">
<api:set attr="postdata" value="abcd">
<api:set attr="contenttype" value="text/plain">
<api:call op="httpops.post" out="output">
<api:set attr="temp.data" value="[output.content]">
</api:call >