Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ gem 'excon'
gem 'net-http-persistent'
gem 'faraday'
gem 'patron'
gem 'httparty'
6 changes: 5 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ GEM
domain_name (~> 0.5)
http-form_data (1.0.1)
http_parser.rb (0.6.0)
httparty (0.16.2)
multi_xml (>= 0.5.2)
i18n (0.7.0)
kgio (2.10.0)
loofah (2.0.3)
Expand All @@ -76,6 +78,7 @@ GEM
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
minitest (5.9.0)
multi_xml (0.6.0)
multipart-post (2.0.0)
net-http-persistent (2.9.4)
netrc (0.11.0)
Expand Down Expand Up @@ -151,6 +154,7 @@ DEPENDENCIES
excon
faraday
http
httparty
net-http-persistent
patron
puma
Expand All @@ -161,4 +165,4 @@ DEPENDENCIES
unicorn

BUNDLED WITH
1.12.5
1.16.1
1 change: 1 addition & 0 deletions lib/http-clients.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
require 'http-clients/faraday_net_http_client'
require 'http-clients/patron_client'
require 'http-clients/benchmark'
require 'http-clients/httparty_client'

module HTTPClients
end
1 change: 1 addition & 0 deletions lib/http-clients/benchmark.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def clients
ExconClient.new(endpoint, persistent, concurrent),
FaradayNetHttpClient.new(endpoint, persistent, concurrent),
PatronClient.new(endpoint, persistent, concurrent),
HTTPartyClient.new(endpoint, persistent, concurrent),
]

if client
Expand Down
18 changes: 18 additions & 0 deletions lib/http-clients/httparty_client.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'httparty'

module HTTPClients
class HTTPartyClient < BaseClient
def name
"HTTParty"
end

def run_once
HTTParty.get(endpoint, verify: false)
end

def response_ok?(response)
response.code == 200
end

end
end