Skip to main content

HTTP request

Anatomy

<http:request var="var" var_info="var" timeout="30" url="string" validate="bool" method="GET">
<http:header>string</http:header>
<http:body>string</http:body>
</http:request>

Description: HTTP:REQUEST sends a HTTP/1.1 request and receives a HTTP response according to RFC 2616.

HTTP:REQUEST returns an array in 'var_info' comprised of the following items:

Key Description

status response status code type response content type header response header body response body

Attention:

The Content-Length header field defaults to the size of the HTTP body. The Content-Type header field defaults to application/x-www-form-urlencoded only for method POST.

Attributes

NameTypeDescriptionDefined By
varvarResult variable name for response body http:request
var_infovarResult variable name for detailed response information http:request
timeoutintTimeout in seconds http:request
urlstringURL http:request
validateboolValidate SSL http:request
methodstringMethod http:request

Results:

BindingTypePredicate
varstringN/A
var_infoarrayno-result-propagation

Children

http:header

Anatomy of HTTP header

<http:header>string</http:header>
http:body

Anatomy of HTTP body

<http:body>string</http:body>

Examples

Example

<decode:json var="data">
<http:request url="https://api.predic8.de/shop/products/" method="POST">
<http:header>
Content-Type: application/json
</http:header>

<http:body>
{"name": "Wildberries", "price": 4.99}
</http:body>
</http:request>
</decode:json>

<set var="route">$data.product_url</set>

<decode:json var="data">
<http:request url="https://api.predic8.de$route" method="GET"/>
</decode:json>

<output>$data.name</output>

<!-- Wildberries -->