Module: HTTP::Session::Requestable

Included in:
HTTP::Session
Defined in:
lib/http/session/requestable.rb

Overview

Provides the same request API interfaces as HTTP::Client.

Mostly borrowed from http/lib/http/chainable.rb

Instance Method Summary collapse

Instance Method Details

#connect(uri, options = {}) ⇒ Response

Convert to a transparent TCP/IP tunnel.

Parameters:

  • uri
  • [Hash] (Hash)

    a customizable set of options

Returns:



74
75
76
# File 'lib/http/session/requestable.rb', line 74

def connect(uri, options = {})
  request :connect, uri, options
end

#delete(uri, options = {}) ⇒ Response

Delete a resource.

Parameters:

  • uri
  • [Hash] (Hash)

    a customizable set of options

Returns:



47
48
49
# File 'lib/http/session/requestable.rb', line 47

def delete(uri, options = {})
  request :delete, uri, options
end

#get(uri, options = {}) ⇒ Response

Get a resource.

Parameters:

  • uri
  • [Hash] (Hash)

    a customizable set of options

Returns:



20
21
22
# File 'lib/http/session/requestable.rb', line 20

def get(uri, options = {})
  request :get, uri, options
end

#head(uri, options = {}) ⇒ Response

Request a get sans response body.

Parameters:

  • uri
  • [Hash] (Hash)

    a customizable set of options

Returns:



11
12
13
# File 'lib/http/session/requestable.rb', line 11

def head(uri, options = {})
  request :head, uri, options
end

#options(uri, options = {}) ⇒ Response

Return the methods supported on the given URI.

Parameters:

  • uri
  • [Hash] (Hash)

    a customizable set of options

Returns:



65
66
67
# File 'lib/http/session/requestable.rb', line 65

def options(uri, options = {})
  request :options, uri, options
end

#patch(uri, options = {}) ⇒ Response

Apply partial modifications to a resource.

Parameters:

  • uri
  • [Hash] (Hash)

    a customizable set of options

Returns:



83
84
85
# File 'lib/http/session/requestable.rb', line 83

def patch(uri, options = {})
  request :patch, uri, options
end

#post(uri, options = {}) ⇒ Response

Post to a resource.

Parameters:

  • uri
  • [Hash] (Hash)

    a customizable set of options

Returns:



29
30
31
# File 'lib/http/session/requestable.rb', line 29

def post(uri, options = {})
  request :post, uri, options
end

#put(uri, options = {}) ⇒ Response

Put to a resource.

Parameters:

  • uri
  • [Hash] (Hash)

    a customizable set of options

Returns:



38
39
40
# File 'lib/http/session/requestable.rb', line 38

def put(uri, options = {})
  request :put, uri, options
end

#trace(uri, options = {}) ⇒ Response

Echo the request back to the client.

Parameters:

  • uri
  • [Hash] (Hash)

    a customizable set of options

Returns:



56
57
58
# File 'lib/http/session/requestable.rb', line 56

def trace(uri, options = {})
  request :trace, uri, options
end