Skip to content

An extension for the HTTParty gem ( Adds ability to retry on failures and connection errors)

Notifications You must be signed in to change notification settings

zaagan/extended-httparty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

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

About

An extension for the HTTParty gem ( Adds ability to retry on failures and connection errors)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages