Http Operations


Http Operations


Http Operations allow you to send http requests.

The example below uses the httpPost operation in the Post Job Event to send a json payload to the specified url:

<api:info title="After Run" desc="This event is fired after running a job.">
  <input name="JobName"         required="true" desc="The name of the job being executed." />
  <input name="Source"          required="true" desc="The name of source connection." />
  <input name="Destination"     required="true" desc="The name of destination connection." />
  <input name="JobStatus"       required="true" desc="The status of the completed run."/>
  <input name="Query#"          required="true" desc="An array containing each query that was executed." />
  <input name="QueryStatus#"    required="true" desc="An array containing the status of each query that was executed." />
</api:info>

<api:set attr="http.url"  value="http://mysite.com/log/"/> 
<api:set attr="http.header:name#1"  value="Token"/>
<api:set attr="http.header:value#1"  value="MyToken"/>
<api:set attr="http.contenttype"  value="application/json"/>
<api:set attr="http.postdata">
{
	"JobName":"[_input.jobname]",
	"Status":"[_input.JobStatus]
}
</api:set>

<api:call op="httpPost" in="http"/>

Operations

httpGet

Get a document from the Web using the HTTP GET method.

Required Input Attribute Description
url The URL to retrieve.
Optional Input Attribute Description
timeout The timeout, in seconds, for the operation to complete. Zero (0) means no timeout. The default value is ‘60’.
cookie:* Any cookies to add to the request.
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. The allowed values are ‘BASIC, DIGEST, NTLM’. The default value is ‘BASIC’.
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.
ifmodifiedsince The if-modified-since date and time to use as a filter for the results retrieved (for example: Sat, 25 Feb 2006 04:11:47 GMT).
localfile If specified, the results of the GET will be written to this file.
logfile The full path to a file to log request and response data. Must be used in conjuction with verbosity.
verbosity The verbosity of the log file, from 1 (least verbose) to 5 (most verbose).
Ouptut Attribute Description
ssl:issuer The issuer of the SSL/TLS certificate.
ssl:subject The subject of the SSL/TLS certificate.
http:statuscode The HTTP status code returned from the request.
http:content The content of the HTTP response.
cookie:* The cookies returned with the response.
http:allcookies All of the cookies from the response, returned as a single string.
header:* The headers returned with the response.

httpPost

Post data to a URL using the HTTP POST method.

Required Input Attribute Description
url The destination URL.
Optional Input Attribute Description
timeout The timeout, in seconds, for the operation to complete. Zero (0) means no timeout. The default value is ‘60’.
cookie:* Any cookies to add to the request.
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. The allowed values are ‘BASIC, DIGEST, NTLM’. The default value is ‘BASIC’.
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.
ifmodifiedsince The if-modified-since date and time to use as a filter for the results retrieved (for example: Sat, 25 Feb 2006 04:11:47 GMT).
localfile If specified, the results of the GET will be written to this file.
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.
postdata Data to include in the POST. Use file:// followed by a file path to post the contents of a file.
contenttype The content type for the POST. The default value is ‘application/x-www-form-urlencoded’.
logfile The full path to a file to log request and response data. Must be used in conjuction with verbosity.
verbosity The verbosity of the log file, from 1 (least verbose) to 5 (most verbose).
Ouptut Attribute Description
ssl:issuer The issuer of the SSL/TLS certificate.
ssl:subject The subject of the SSL/TLS certificate.
http:statuscode The HTTP status code returned from the request.
http:content The content of the HTTP response.
cookie:* The cookies returned with the response.
http:allcookies All of the cookies from the response, returned as a single string.
header:* The headers returned with the response.

httpPut

Put a Web document using the HTTP PUT method.

Required Input Attribute Description
url The destination URL.
Optional Input Attribute Description
timeout The timeout, in seconds, for the operation to complete. Zero (0) means no timeout. The default value is ‘60’.
cookie:* Any cookies to add to the request.
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. The allowed values are ‘BASIC, DIGEST, NTLM’. The default value is ‘BASIC’.
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.
ifmodifiedsince The if-modified-since date and time to use as a filter for the results retrieved (for example: Sat, 25 Feb 2006 04:11:47 GMT).
localfile If specified, the results of the GET will be written to this file.
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.
putdata Data to include in the PUT. Use file:// followed by a file path to put the contents of a file.
contenttype The content type for the POST. The default value is ‘text/html’.
logfile The full path to a file to log request and response data. Must be used in conjuction with verbosity.
verbosity The verbosity of the log file, from 1 (least verbose) to 5 (most verbose).
Ouptut Attribute Description
ssl:issuer The issuer of the SSL/TLS certificate.
ssl:subject The subject of the SSL/TLS certificate.
http:statuscode The HTTP status code returned from the request.
http:content The content of the HTTP response.
cookie:* The cookies returned with the response.
http:allcookies All of the cookies from the response, returned as a single string.
header:* The headers returned with the response.