Results for: "strip"

No documentation available

Like Net::HTTP.get, but writes the returned body to $stdout; returns nil.

Posts data to a host; returns a Net::HTTPResponse object.

Argument url must be a URI; argument data must be a hash:

_uri = uri.dup
_uri.path = '/posts'
data = {title: 'foo', body: 'bar', userId: 1}
res = Net::HTTP.post_form(_uri, data) # => #<Net::HTTPCreated 201 Created readbody=true>
puts res.body

Output:

{
  "title": "foo",
  "body": "bar",
  "userId": "1",
  "id": 101
}

Sets the write timeout, in seconds, for self to integer sec; the initial value is 60.

Argument sec must be a non-negative numeric value.

No documentation available

Sends a GET request to the path. Returns the response as a Net::HTTPResponse object.

When called with a block, passes an HTTPResponse object to the block. The body of the response will not have been read yet; the block can process it using HTTPResponse#read_body, if desired.

Returns the response.

This method never raises Net::* exceptions.

response = http.request_get('/index.html')
# The entity body is already read in this case.
p response['content-type']
puts response.body

# Using a block
http.request_get('/index.html') {|response|
  p response['content-type']
  response.read_body do |str|   # read body now
    print str
  end
}

Sends a HEAD request to the path and returns the response as a Net::HTTPResponse object.

Returns the response.

This method never raises Net::* exceptions.

response = http.request_head('/index.html')
p response['content-type']

Sends an HTTP request to the HTTP server. Also sends a DATA string if data is given.

Returns a Net::HTTPResponse object.

This method never raises Net::* exceptions.

response = http.send_request('GET', '/index.html')
puts response.body
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available

States

No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
Search took: 3ms  ·  Total Results: 1534