Class RestClient::Response
In: lib/restclient/response.rb
Parent: String

The response from RestClient looks like a string, but is actually one of these. 99% of the time you‘re making a rest call all you care about is the body, but on the occassion you want to fetch the headers you can:

  RestClient.get('http://example.com').headers[:content_type]

Methods

beautify_headers   code   cookies   headers   new  

Attributes

net_http_res  [R] 

Public Class methods

Public Instance methods

HTTP status code, always 200 since RestClient throws exceptions for other codes.

Hash of cookies extracted from response headers

A hash of the headers, beautified with symbols and underscores. e.g. "Content-type" will become :content_type.

[Validate]