SF::Http::Response
Inherits Reference / Object
Define a HTTP response
Constructors
Instance methods
Get the body of the response
The body of a response may contain:
- the requested page (for GET requests)
- a response from the server (for POST requests)
- nothing (for HEAD requests)
- an error message (in case of an error)
Returns: The response body
Returns a shallow copy of this object.
This allocates a new object and copies the contents of
self into it.
Get the value of a field
If the field field is not found in the response header, the empty string is returned. This function uses case-insensitive comparisons.
- field - Name of the field to get
Returns: Value of the field, or empty string if not found
Get the major HTTP version number of the response
Returns: Major HTTP version number
See also: minor_http_version
Get the minor HTTP version number of the response
Returns: Minor HTTP version number
See also: major_http_version
Get the response status code
The status code should be the first thing to be checked after receiving a response, it defines whether it is a success, a failure or anything else (see the Status enumeration).
Returns: Status code of the response