WebServiceResponse
Contains all information about web service custom request execution result
Instance attributes
- agentErrorCode: int
-
Agent error code (
0if the agent completed the request)
- body: String
-
Response body. Alias for
document.
- document: String
-
Document that was returned by web service as a response to the request. For HTTP error responses and unfollowed redirects, contains the response body.
- errorMessage: String
-
Human readable error message set by server or agent (empty string if there is no error)
- headers: HashMap
-
Headers of the final response (after followed redirects) as hash map. Header names are converted to lower case; values of repeated headers are joined with comma.
nullif the agent does not report response headers (agents older than the server).
- httpResponseCode: int
-
HTTP response code
- redirectUrl: String
-
Target URL of an HTTP redirect that was not followed (following redirects is disabled in the web service definition, or redirect limit reached), or
nullif the response was not a redirect.
- statusCode: int
-
HTTP response status code. Alias for
httpResponseCode.
- success: bool
-
trueif the agent completed the request and received an HTTP response,falseif there was a problem on server or on agent (no connection, timeout, communication failure). HTTP error responses (4xx, 5xx) and unfollowed redirects are reported withsuccessset totrue; check statusCode.
Instance methods
- getHeader(name): String
-
Get response header value. Header name is matched case-insensitively.
Table 1. Parameters name
String
Header name.
ReturnHeader value, or
nullif the header is not present or the agent does not report response headers.result = $node.getWebService("webSvcName").get(); println("Content type: " .. result.getHeader("Content-Type"));