Giving an URL connection established through the function http.connection returns the state of the connection response. The possible states are:
- HTTP Status-Code 202: Accepted.
- HTTP Status-Code 502: Bad Gateway.
- HTTP Status-Code 405: Method Not Allowed.
- HTTP Status-Code 400: Bad Request.
- HTTP Status-Code 408: Request Time-Out.
- HTTP Status-Code 409: Conflict.
- HTTP Status-Code 201: Created.
- HTTP Status-Code 413: Request Entity Too Large.
- HTTP Status-Code 403: Forbidden.
- HTTP Status-Code 504: Gateway Timeout.
- HTTP Status-Code 410: Gone.
- HTTP Status-Code 500: Internal Server Error.
- HTTP Status-Code 411: Length Required.
- HTTP Status-Code 301: Moved Permanently.
- HTTP Status-Code 302: Temporary Redirect.
- HTTP Status-Code 300: Multiple Choices.
- HTTP Status-Code 204: No Content.
- HTTP Status-Code 406: Not Acceptable.
- HTTP Status-Code 203: Non-Authoritative Information.
- HTTP Status-Code 404: Not Found.
- HTTP Status-Code 501: Not Implemented.
- HTTP Status-Code 304: Not Modified.
- HTTP Status-Code 200: OK.
- HTTP Status-Code 206: Partial Content.
- HTTP Status-Code 402: Payment Required.
- HTTP Status-Code 412: Precondition Failed.
- HTTP Status-Code 407: Proxy Authentication Required.
- HTTP Status-Code 414: Request-URI Too Large.
- HTTP Status-Code 205: Reset Content.
- HTTP Status-Code 303: See Other.
- HTTP Status-Code 401: Unauthorized.
- HTTP Status-Code 503: Service Unavailable.
- HTTP Status-Code 415: Unsupported Media Type.
- HTTP Status-Code 305: Use Proxy.
- HTTP Status-Code 505: HTTP Version Not Supported.
1 http.connection.getResponseCode
<http.connection.getResponseCode>
<http_connection /> !
</http.connection.getResponseCode>
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Ehttp_connection | HttpURLConnectionWrapper | URL connection established to a web address. |
Returns | |
---|---|
Type | Description |
int | Returns the code of HTTP state. Returns -1 if the answer could not be resolved (invalid answer). |
Example
Obtain the answer code of an URL connection established. The function http.connection returns an URL connection and with http.conection.getResponseCode is obtained the code of HTTP state.
Copy
<xsql-script name='http_connection_grc'> <body> <println> <http.connection.getResponseCode> <http.connection url='http://www.google.es' /> </http.connection.getResponseCode> </println> </body> </xsql-script>