HttpResponse type variable

Available from version 5.4.8.

The HttpResponse type variable (after any redirection) is a type which contains all information of the response of a query web service routing.

The special keyword CurrentHttpResponse  (after any redirection) provide a useful access to the response of a query web service routing.

This variable is within the local scope, so is available only in the Response success or error of a query web service routing.

 

This topic covers:

Properties

Headers

Available from version 5.4.8.

Returns a dictionary with all the headers of the response.

Return a Dictionary of string or array of string.


' GET https://postman-echo.com/response-headers?Content-Type=text/html&test=response_headers
' Headers
' @{ 
' "access-control-allow-credentials" : "",
' "access-control-allow-headers" : "",
' "access-control-allow-methods" : "",
' "access-control-allow-origin" : "",
' "access-control-expose-headers" : "",
' "connection" : "keep-alive",
' "content-encoding" : "gzip"
' "content-length" : "71",
' "content-type" : "text/html; charset=utf-8",
' "date" : "Mon, 28 Aug 2017 10:22:07 GMT",
' "etag" : "W/"36-qe7rHYvOo7E1gYg5rYfFsg"",
' "server" : "nginx/1.10.2",
' "test" : "response_headers",
' "vary" : "Accept-Encoding"
' }

CurrentHttpResponse.Headers.Count ' => "14"
CurrentHttpResponse.Headers.TypeOf() ' => "dictionary"

CurrentHttpResponse.Headers["connection"].TypeOf() ' => "variant"
CurrentHttpResponse.Headers["connection"].InnerTypeOf() ' => "string"
CurrentHttpResponse.Headers["connection"] ' => "keep-alive"

CurrentHttpResponse.Headers["content-length"].TypeOf() ' => "variant"
CurrentHttpResponse.Headers["content-length"].InnerTypeOf() ' => "string"
CurrentHttpResponse.Headers["content-length"] ' => "71"

CurrentHttpResponse.Headers["access-control-allow-headers"].TypeOf() ' => "variant"
CurrentHttpResponse.Headers["access-control-allow-headers"].InnerTypeOf() ' => "string"
CurrentHttpResponse.Headers["access-control-allow-headers"] ' => ""

The dictionary object in askiascript doesn't allow repeated keys so for the CurrentHttpResponse.Headers, the repeated properties/keys appear as one property/key and the value will be an Array

↑ Top of page ↑

StatusCode

Available from version 5.4.8.

Returns the status code of the response as number.

Return a Number


' GET https://postman-echo.com/response-headers?Content-Type=text/html&test=response_headers

CurrentHttpResponse.StatusCode ' => 200

↑ Top of page ↑

StatusCodeMessage

Available from version 5.4.8.

Returns the status code message of the response as string.

Return a String


' GET https://postman-echo.com/response-headers?Content-Type=text/html&test=response_headers

CurrentHttpResponse.StatusCodeMessage ' => "OK"

↑ Top of page ↑

Body

Available from version 5.4.8.

Returns the body of the response as string.

Return a String


' GET https://postman-echo.com/response-headers?Content-Type=text/html&test=response_headers

CurrentHttpResponse.Body ' => "{"Content-Type":"text/html","test":"response_headers"}"

↑ Top of page ↑

 

Methods

ToString()

Available from version 5.4.8.

Returns a string which represent the HttpResponse (express in JSON format).

Returns a String.


' GET https://postman-echo.com/response-headers?Content-Type=text/html&test=response_headers
' Output in a single line (it's broken in different lines here for readability)

CurrentHttpResponse.ToString()

' => {
' "headers" : { 
' "access-control-allow-credentials" : "",
' "access-control-allow-headers" : "",
' "access-control-allow-methods" : "",
' "access-control-allow-origin" : "",
' "access-control-expose-headers" : "",
' "connection" : "keep-alive",
' "content-encoding" : "gzip"
' "content-length" : "71",
' "content-type" : "text/html; charset=utf-8",
' "date" : "Mon, 28 Aug 2017 10:22:07 GMT",
' "etag" : "W/"36-qe7rHYvOo7E1gYg5rYfFsg"",
' "server" : "nginx/1.10.2",
' "test" : "response_headers",
' "vary" : "Accept-Encoding"
' },
' "StatusCode" : "200",
' "StatusCodeMessage" : "OK",
' "Body" : "{"Content-Type":"text/html","test":"response_headers"}"
' }

↑ Top of page ↑

TypeOf()

Available from version 5.4.8.

Always return "httpresponse".

Returns a String.


' GET https://postman-echo.com/response-headers?Content-Type=text/html&test=response_headers

CurrentHttpResponse.TypeOf() ' => "httpresponse"

↑ Top of page ↑

Create your own Knowledge Base