Class: OmniauthOpenidFederation::HttpClient
- Inherits:
-
Object
- Object
- OmniauthOpenidFederation::HttpClient
- Defined in:
- lib/omniauth_openid_federation/http_client.rb
Constant Summary collapse
- RETRYABLE_ERRORS =
[ HTTP::Error, Timeout::Error, Errno::ECONNREFUSED, Errno::ETIMEDOUT ].freeze
- RETRYABLE_HTTP_STATUS_CODES =
[429, 502, 503].freeze
Class Method Summary collapse
-
.get(uri, options = {}) ⇒ HTTP::Response
Execute an HTTP GET request with retry logic.
-
.post(uri, options = {}) ⇒ HTTP::Response
Execute an HTTP POST request with retry logic.
Class Method Details
.get(uri, options = {}) ⇒ HTTP::Response
Execute an HTTP GET request with retry logic
29 30 31 |
# File 'lib/omniauth_openid_federation/http_client.rb', line 29 def self.get(uri, = {}) request(:get, uri, ) end |
.post(uri, options = {}) ⇒ HTTP::Response
Execute an HTTP POST request with retry logic
POST defaults to max_retries: 0 because retries are not safe for non-idempotent requests. Pass max_retries explicitly when duplicate POST attempts are acceptable.
43 44 45 |
# File 'lib/omniauth_openid_federation/http_client.rb', line 43 def self.post(uri, = {}) request(:post, uri, ) end |