multipart?

multipart?() Instance Public methods

value

value() Instance Public methods Raises an HTTP error if the response is not 2xx (success).

read_body

read_body(dest = nil, &block) Instance Public methods Gets the entity body returned by the remote HTTP server. If a block is given, the body is passed to the block, and the body is provided in fragments, as it is read in from the socket. Calling this method a second or subsequent time for the same HTTPResponse object will return the value already read. http.request_get('/index.html') {|res| puts res.read_body } http.request_get('/index.html') {|res| p res.read_body.object_

inspect

inspect() Instance Public methods

entity

entity() Instance Public methods Alias for: body

body=

body=(value) Instance Public methods Because it may be necessary to modify the body, Eg, decompression this method facilitates that.

body

body() Instance Public methods Returns the full entity body. Calling this method a second or subsequent time will return the string already read. http.request_get('/index.html') {|res| puts res.body } http.request_get('/index.html') {|res| p res.body.object_id # 538149362 p res.body.object_id # 538149362 } entity

body_permitted?

body_permitted?() Class Public methods true if the response has a body.

new

new(path, initheader = nil) Class Public methods Creates an HTTP request object for path. initheader are the default headers to use. Net::HTTP adds Accept-Encoding to enable compression of the response body unless Accept-Encoding or Range are supplied in initheader.

type_params

type_params() Instance Public methods Any parameters specified for the content type, returned as a Hash. For example, a header of Content-Type: text/html; charset=EUC-JP would result in #type_params returning {'charset' => 'EUC-JP'}