![]() |
| > Home > Documentation > Latest documentation > Interchange tags > get-url |
|
get-urlFetch data from, or post data to, a specified URI. Summary
ExamplesTag expansion example
Perl example
or similarly with positional parameters:
DescriptionThis tag can be used to fetch data from, or post data to, a specified URI. For instance, the following will POST a form consisting of two CGI variables, called "first_name" and "last_name", to the "http://www.example.com/someform.html" URI. Any data received as a result of the posting of this request will be collected and stored in a scratchpad variable called "result":
ParametersurlThe URI from which you would like to retrieve data. The "url" parameter must contain a fully formed URI, including the protocol, the host/domain name and the page/path. For example, "http://www.example.com/path/to/foo.html". URI parameters (CGI variables) should be specified using the form or content parameters, rather than encoded into the URI using the url parameter. authpassPassword to send for authentication, if required by the remote URI. authuserUser name to send for authentication, if required by the remote URI. contentFreeform data to pass to the remote URI as part of the request. If the request type is "POST" or "PUT" then the data will be sent as form data, otherwise it will be appended to the requested URI, as URI parameter(s). Multiple variables must be separated from one another using an ampersand (&) character. This tag will not hex-encode non-word characters in the content for you. You must call [filter op="urlencode"] yourself, if your data is likely to contain non-word characters.
content_typeIf you are POSTing a request to the URI then you may need to override the default Content-Type HTTP header value. The default Content-Type for "POST" and "PUT" methods is "application/x-www-form-urlencoded"".
formCGI variable(s) to pass to the remote URI as part of the request. If the request type is "POST" or "PUT" then the variable(s) will be sent as form data, otherwise they will be appended to the requested URI, as URI parameter(s). Variables must be specified as "name=value" pairs, and each variable must be on its own line. Non-word characters in the names and values will be URI-encoded automatically.
methodThe HTTP retrieval method you would like to use. Valid methods are "GET", "HEAD", "POST" and "PUT". scratchIf this parameter is given then the return value will be saved to the named scratchpad variable instead of simply being returned as this tag's output. stripThis tag will return all of the content received from the requested URI by default. If you set this parameter true then only the content between "<body>" and "</body>" will be returned. timeoutDon't wait any longer than this amount of time for a response from the remote server. This parameter can be specified as a number of seconds, or can be specified as a time interval, such as "1 minute" or "20 seconds" etc. The default timeout value is 180 seconds (or "3 minutes"). useragentThe browser identification value you would like to send with this request.
|
| Home | Legal nonsense | Privacy policy | Contact us |