httpPost
Post data to a URL using the HTTP POST method.
Required Parameters
- url: The destination URL
Optional Parameters
- timeout: The timeout, in seconds, for the operation to complete. Zero (0) means no timeout. Default is 60
- proxy_server: The IP address or host name of the proxy server
- proxy_auto: Whether the proxy should be detected from Windows system settings. Allowed values: TRUE, FALSE. Default is FALSE
- proxy_port: The port number of the proxy server
- proxy_user: The user ID for the proxy server
- proxy_password: The password for the proxy server
- proxy_authscheme: Authentication scheme of the proxy server. Allowed values: BASIC, DIGEST, PROPRIETARY, NONE, NTLM. Default is BASIC
- proxy_authtoken: Proxy authentication token
- proxy_ssltype: SSL/TLS type of the proxy. Allowed values: AUTO, ALWAYS, NEVER, TUNNEL. Default is AUTO
- firewall_server: IP or host name of the firewall
- firewall_port: Port of the firewall
- firewall_user: Username for the firewall
- firewall_password: Password for the firewall
- firewall_type: Type of firewall. Allowed values: NONE, TUNNEL, SOCKS4, SOCKS5. Default is NONE
- kerberoskdc: Kerberos KDC setting, used when authscheme is Negotiate
- kerberosrealm: Kerberos realm setting, used when authscheme is Negotiate
- internalconfig#: Sets an internal configuration setting
- charset: Charset of exchanged data. Default is UTF-8
- httpversion: HTTP version. Allowed values: 1.0, 1.1. Default is 1.1
- cookie:*: Any cookies to add to the request
- followredirects: Whether to follow HTTP redirects. Allowed values: TRUE, FALSE. Default is TRUE
- sslcert: SSL/TLS certificate to accept. Can be PEM, file path, public key, thumbprint, or TRUSTED
- sslclientcert: Name of the client certificate store
- sslclientcerttype: Store type for the client certificate. Allowed values: USER, MACHINE, PFXFILE, etc
- sslclientcertpassword: Password for the client certificate
- sslclientcertsubject: Subject of the client certificate. An asterisk finds the first in the store
- user: Username for authentication
- password: Password for authentication
- authscheme: Authorization mechanism. Allowed values: BASIC, DIGEST, NTLM. Default is BASIC
- version: OAuth version. Allowed values: Disabled, 1.0, 2.0. Default is Disabled
- token: OAuth request token
- token_secret: OAuth request token secret (1.0 only)
- sign_method: Signature method for OAuth 1.0. Allowed values: HMAC-SHA1, PLAINTEXT. Default is HMAC-SHA1
- client_id: Client ID (OAuth 1.0 only)
- client_secret: Client secret (OAuth 1.0 only)
- header:name#: Name of a custom header
- header:value#: Value of a custom header
- paramname#: Name of a parameter to include
- paramvalue#: Value of a parameter to include
- formencoding: Encoding for parameters. Allowed values: URLENCODED, FORMDATA. Default is URLENCODED
- postdata: Raw data to include in the POST. Use file://path to include a file
- contenttype: Content type of the POST. Default is application/x-www-form-urlencoded
- logfile: Full path to log file for request/response data (requires verbosity)
- verbosity: Log verbosity, 1-5
Output Attributes
- ssl:issuer: Issuer of the SSL/TLS certificate
- ssl:subject: Subject of the SSL/TLS certificate
- http:statuscode: HTTP status code returned
- http:content: Content of the HTTP response
- cookie:*: Cookies returned with the response
- http:allcookies: All response cookies as a single string
- header:*: Headers returned with the response
Example
<api:set item="http" attr="URL" value="http://example.com/people"/> <api:set item="http" attr="paramname#1" value="name"/> <api:set item="http" attr="paramvalue#1" value="Charlie"/> <api:set item="http" attr="paramname#2" value="age"/> <api:set item="http" attr="paramvalue#2" value="28"/> <api:call op="httpPost" in="http"> <api:set attr="output.data" value="[http:content]"/> </api:call> <api:set attr="output.filename" value="httpContent.txt"/> <api:push item="output"/>