Syntax @Http( GET|POST|DELETE|PUT, , [, ] ) @Http( URL_ENCODE, ) @Http( URL_DECODE, ) Arguments The download or upload operation requested. This must be one of GET, POST, DELETE, or PUT. Other HTTP operations are currently unsupported. Range: GET|POST|DELETE|PUT The target URL to perform the operation on. Range: String The results of the operation will be stored in this attribute. Range: String The name of the auxiliary information table. For instructions regarding construction of this table, please see the Configuration section. Range: String When using the URL_ENCODE action, this is the string which will be encoded. Range: String When using the URL_DECODE action, this is the string which will be decoded. Range: String Configuration When performing an HTTP GET, POST, PUT or DELETE, this function can accept an optional auxiliary table in order to store extra information which may be needed during translation. HTTPRequest [REQUEST_HEADER ]* [HTTP_USERNAME ] [HTTP_PASSWORD ] [HTTP_AUTHMETHOD ] [PROXY_URL ] [PROXY_PORT ] [PROXY_USERNAME ] [PROXY_PASSWORD ] [PROXY_AUTHMETHOD ] [UPLOAD_BODY ] [UPLOAD_FILE ] [UPLOAD_CONTENT_TYPE ] [USE_RECV_HEADER_ENCODING ] [CONTINUE_ON_ERROR ] [SAVED_HEADERS_ATTR ] [USE _COOKIES ] The name of the auxiliary information table. Range: String A single custom request header enclosed in quotations. The REQUEST_HEADER tag may be used multiple times to generate multiple custom headers. Range: String The HTTP basic access authentication username. Range: String The HTTP basic access authentication password. Range: String The HTTP basic access authentication method. Range: Basic|Digest|NTLM The target proxy URL. Range: String The target proxy port. Range: Integer The username for proxy authentication. Range: String The password for proxy authentication. Range: String The proxy authentication method to be used. Range: Basic|Digest|NTLM The message to be uploaded. To be used with POST and PUT only. Range: String The path to the file that is to be uploaded. To be used with POST and PUT only. Range: String The type of content that is to be uploaded. To be used only with POST and PUT. Range: String This specifies if the HTTP Response will be examined for encoding information or not. Defaults to NO. Range: YES|NO This specifies if translation should continue in the event of an error. Defaults to NO. Range: YES|NO If this configuration line is present, the HTTP response headers will be saved as a list attribute. The headers will be split into names and values, resulting in the following attributes: {}.name {}.value Range: List attribute name This specifies if the function should save cookies returned in the HTTP response, and send any saved cookies in the HTTP request. Range: YES|NO Description GET / POST / DELETE / PUT ~~~~~~~~~~~~~~~~~~~~~~~~~ When the first parameter is one of GET/POST/DELETE/PUT, the function will perform the requested operation on the target URL, then reporting the results in an attribute. The HTTP Response status code will be stored in a separate _http_status_code attribute. The first three parameters of the function are mandatory, providing the preferred operation, target URL, and chosen attribute to report the results. The fourth, optional parameter contains the name of an additional information table which handles more advanced settings such as proxy information. Currently, only the HTTP GET, POST, DELETE, and PUT operations are available. Other HTTP operations are unsupported at this time. Specifying GET or DELETE will perform the associated operation on the URL and store the results in the target attribute. Specifying POST or PUT will upload the associated message or file as specified and store the results in the target attribute. The HTTP basic access authentication is supported via the auxiliary configuration table for servers requiring credentials. The username, password and authentication method may be specified via the HTTP_USERNAME, HTTP_PASSWORD, and HTTP_AUTHMETHOD, respectively. Note: The HTTP basic access authentication is a mechanism designed to allow a client to provide credentials to a server on the assumption that the connection between them is trusted and secure. That is, any credentials passed from client to server can be easily intercepted through an insecure connection. To specify a proxy, the auxiliary information table must be created. To avoid confusion, each table name should be unique. The appropriate proxy fields should be filled in order to use a proxy server, including PROXY_URL, PROXY_PORT, PROXY_USERNAME, PROXY_PASSWORD, and PROXY_AUTHMETHOD as necessary. Custom request headers are supported. Custom request headers should follow the REQUEST_HEADER tag, enclosed in quotations. Each header should be separate, following its own REQUEST_HEADER tag. To specify a file or message for upload, the appropriate fields must be completed. One of either a file or a message can be uploaded per function call. If a file is specified, it becomes the body of the HTTP request sent to the server. The content type provided will override the Content-Type header, regardless if one was provided as a custom header. Should the USE_RECV_HEADER_ENCODING tag be set to YES, then the HTTP Response will be examined for encoding information so that the target attribute can be tagged with the encoding. If no encoding is found in the HTTP Response, the target attribute will be tagged as binary data. If this tag is set to NO, then the downloaded data will be considered text data in the current system encoding. If an error occurs and the CONTINUE_ON_ERROR tag is set to YES, then the target attribute will be returned empty and an error message will be logged. Translation will still continue. If the tag is set to NO and an error occurs, the translation will fail and terminate. If the USE_COOKIES parameter is set to YES, then any previously saved cookies whose domain matches that of the requested URL will be sent along with the request. Also, any cookies contained in the response to this request will be saved for sending later. This allows the @http function to access web resources which have session management. The function can be used to perform a 'login' or authentication request, and then used again to perform another request which requires the authenticated session id, which is typically stored in a cookie. URL_ENCODE / URL_DECODE ~~~~~~~~~~~~~~~~~~~~~~~ When the first parameter is URL_ENCODE, then function will URL-encode the string passed in as the second parameter, and return the encoded string. Similarly, when the first parameter is URL_DECODE, the function will decode and portions of the string which are URL-encoded, and return the decoded string. For more information on URL-encoding, see http://en.wikipedia.org/wiki/Percent-encoding.