Skip to content

Latest commit

 

History

History
64 lines (28 loc) · 1014 Bytes

README.md

File metadata and controls

64 lines (28 loc) · 1014 Bytes

extended-httparty

An extension to HTTParty ( Adds Retry capabilities).

Retries HTTP request upto 3 times by default in case of failures and timeouts.

Default Trials : 3

Default Sleep Interval : 3 seconds

Pre-requisites

Install HTTParty.

 gem install httparty

How It Works

Does everything that HTTParty does.

All you got to do is replace the name from HTTParty to ExtendedHttparty.

From :

response = HTTParty.get('http://api.stackexchange.com/2.2/questions?site=stackoverflow')

To :

response = ExtendedHttparty.get('http://api.stackexchange.com/2.2/questions?site=stackoverflow')

Update Trials

You can update the number of trials by passing an integer value as the parameter.

response = ExtendedHttparty.get('your-url', tries: 5)

References