Sha256: 87c67c9d5faf669fb1e721a8ca7d62312630c630e827c76f90a49a7cc69ba09f

Contents?: true

Size: 658 Bytes

Versions: 3

Compression:

Stored size: 658 Bytes

Contents

require "patron"
class PatronAdapter < HTTPBaseAdapter
  def send_get_request
    session = Patron::Session.new
    session.get(parse_uri.to_s, @headers)
  end

  def send_post_request
    session = Patron::Session.new
    session.post(parse_uri.to_s, query_string, @headers)
  end

  def send_post_form_request
    session = Patron::Session.new
    session.post(parse_uri.to_s, @params, @headers)
  end

  def send_multipart_post_request
    data = @params.dup
    file = @params.delete('file')

    session = Patron::Session.new
    session.post_multipart(parse_uri.to_s, data, {file: file.path}, @headers)
  end

  def self.is_libcurl?
    true
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
binnacle-0.5.0 spec/adapters/patron_adapter.rb
binnacle-0.4.9 spec/adapters/patron_adapter.rb
binnacle-0.4.8 spec/adapters/patron_adapter.rb