Class: Roar::Transport::Faraday

Inherits:
Object
  • Object
show all
Defined in:
lib/roar/transport/faraday.rb

Overview

Advanced implementation of the HTTP verbs with the Faraday HTTP library (which can, in turn, use adapters based on Net::HTTP or libcurl)

Depending on how the Faraday middleware stack is configured, this Transport can support features such as HTTP error code handling, redirects, etc.

See Also:

Instance Method Summary collapse

Instance Method Details

#delete_uri(options) ⇒ Object


32
33
34
# File 'lib/roar/transport/faraday.rb', line 32

def delete_uri(options)
  build_connection(options[:uri], options[:as]).delete
end

#get_uri(options) ⇒ Object


16
17
18
# File 'lib/roar/transport/faraday.rb', line 16

def get_uri(options)
  build_connection(options[:uri], options[:as]).get
end

#patch_uri(options) ⇒ Object


28
29
30
# File 'lib/roar/transport/faraday.rb', line 28

def patch_uri(options)
  build_connection(options[:uri], options[:as]).patch(nil, options[:body])
end

#post_uri(options) ⇒ Object


20
21
22
# File 'lib/roar/transport/faraday.rb', line 20

def post_uri(options)
  build_connection(options[:uri], options[:as]).post(nil, options[:body])
end

#put_uri(options) ⇒ Object


24
25
26
# File 'lib/roar/transport/faraday.rb', line 24

def put_uri(options)
  build_connection(options[:uri], options[:as]).put(nil, options[:body])
end