<@td.httpRequest>
The httpRequest tag executes an http request and sets
the
given variable to the response body returned by the request. Added in version 4.2.
This tag contains the following attributes:
-
contentType
- The request body content type. (Equivalent to setting
"Content-Type" header.)
- Required: false
- Type: String
- Default: If sending a file, the content type of the file. Otherwise, none.
-
contextId
- Context ID to preserve request context, such as
cookies
and authentication status, across several requests.
- Required: false
- Type: String
- Default: none
-
contextScope
- The scope, for the context identified by the
contextId to be retained. Possible values are "session" (the
default),
in which case the context persists for the duration of
the user's HTTP
session; "request", in which case the context
expires at the end
of
the current (Titania Delivery) request; or
"global", in which case the
context is shared by all Titania
Delivery users.
- Required: false
- Type: String
- Default: session
-
defaultCharset
- The default character set to use when interpreting
the request entity,
unless otherwise specified by the
Content-Type header.
- Required: false
- Type: String
- Default: UTF-8
-
followRedirects
- Maximum number of redirects to follow. Negative means
unlimited.
- Required: false
- Type: int
- Default: -1
-
headers
- The HTTP headers to set on the request.
- Required: false
- Type: Map
- Default: none
-
itemKey
- If sending the contents of a file, the item key of
the file.
- Required: false
- Type: String
- Default: None
-
method
- The HTTP request method.
- Required: false
- Type: String
- Default: GET
-
parameters
- Additional parameters to set on the request. If the
method is POST
and there is no tag body, the parameters will be
put into an
application/x-www-form-urlencoded request entity.
Otherwise, the parameters will be added to the request URL.
- Required: false
- Type: Map
- Default: none
-
password
- Password for HTTP authentication.
- Required: false
- Type: String
- Default: none
-
projectKey
- If sending the contents of a file, the project key of
the file.
- Required: false
- Type: String
- Default: None
-
rendition
- If sending the contents of a file, the ItemRepresentationType of
the rendition to send.
- Required: false
- Type: String
- Default: ORIGINAL
-
scope
- The scope of the @var attribute. Valid values are
"page" and "request".
- Required: false
- Type: String
- Default: "request"
-
timeout
- Timeout value in seconds.
- Required: false
- Type: int
- Default: 20
-
url
- The URL to request.
- Required: true
- Type: String
- Default: none
-
username
- User name for HTTP authentication.
- Required: false
- Type: String
- Default: none
-
var
- The name of the variable used to access the result.
- Required: false
- Type: String
- Default: none
-
writeResponse
- Whether to write response body to tag output.
- Required: false
- Type: boolean
- Default: false