Questions tagged [faraday]

Simple, but flexible HTTP client library, with support for multiple backends.

Faraday is an HTTP client lib that provides a common interface over many adapters (such as Net::HTTP) and embraces the concept of Rack middleware when processing the request/response cycle.

271 questions
42
votes
1 answer

What is "timeout" and "open timeout" in Faraday?

Since Faraday doesn't have documentation, I wasn't able to find it out anywhere. What is "timeout" and what "open timeout" in Faraday?
Janko
  • 8,985
  • 7
  • 34
  • 51
22
votes
1 answer

OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: certificate verify failed

I have Rails API server hosted on Heroku, which makes an asynchronous POST request to a callback url specified in an initial API request by the client. I have a problem when I try to POST to one of my clients' webapp over SSL. connection =…
Tarlen
  • 3,657
  • 8
  • 30
  • 54
14
votes
1 answer

Why use Faraday over Net::HTTP?

Why would someone use the Faraday gem vs directly using Net::HTTP? What is the benefit of using a wrapper like this?
user3084728
  • 565
  • 1
  • 8
  • 16
14
votes
1 answer

RuntimeError: :json is not registered on Faraday::Request

I am fairly new to ruby and I am trying to execute a spec and I receive this error: RuntimeError:           :json is not registered on Faraday::Request I am trying to use this gem: https://github.com/Chicago/windy Mac OS X 10.7.4 Ruby 1.9.3,…
Jamie
  • 3,094
  • 1
  • 18
  • 28
13
votes
1 answer

Looking for Example of Faraday Middleware with Error checking

I am looking for an example of Faraday Middleware that handles http (status code) errors on requests and additionally network timeouts. After reading the docs for Faraday and it's middleware it's my understanding that this is one of middleware's…
user3084728
  • 565
  • 1
  • 8
  • 16
12
votes
2 answers

faraday timeout on a simple get

Is there a way to add timeout options in this simple get method? I am using Faraday 3.3. Faraday.get(url) After searching around, I can only apply timeout options after I initiate a connection first, then apply timeout options. Or there's a simple…
Zhaohan Weng
  • 378
  • 1
  • 4
  • 10
12
votes
5 answers

Ruby stubbing with faraday, can't get it to work

Sorry for the title, I'm too frustrated to come up with anything better right now. I have a class, Judge, which has a method #stats. This stats method is supposed to send a GET request to an api and get some data as response. I'm trying to test this…
Majoren
  • 983
  • 5
  • 16
  • 36
11
votes
1 answer

Faraday::ConnectionFailed (end of file reached)

I'm using the Oauth2 Gem to connect to a service. I can receive the authorisation code but when I use that code to retrieve the user token, I get Faraday::ConnectionFailed (end of file reached): Most of the other problems are attributed to out of…
Andrew Lynch
  • 1,297
  • 3
  • 14
  • 25
10
votes
3 answers

Stubbing with Faraday and Rspec

I have a model that looks like this: class Gist def self.create(options) post_response = Faraday.post do |request| request.url 'https://api.github.com/gists' request.headers['Authorization'] = "Basic " +…
michael
  • 2,977
  • 3
  • 20
  • 26
9
votes
2 answers

Firebase iOS Distribution Faraday server error 403

I'm using Circle-Ci and Firebase App Distribution for our Continuous Distribution Every thing was working perfectly until today I'm receiving the below error: [10:52:11]: --- Step: firebase_app_distribution --- [10:52:11]:…
ANeme
  • 731
  • 5
  • 19
9
votes
1 answer

Getting "Authentication failure! invalid_credentials: OAuth2::Error" for custom omniauth strategy

Currently I am working on rails 4 project, and now I have to link / connect another application (not sso but for accessing API's) say example.com. (Note: example.com uses 3-legged oauth security architecture) After searching found that I have to…
I-am-simple-user
  • 409
  • 7
  • 19
9
votes
2 answers

Is it safe to reuse Faraday connection objects?

Is it safe to reuse Faraday connection objects, or is it better to recreate them every time? def connection @connection ||= Faraday.new('http://example.com') do |conn| conn.request :url_encoded # more configuration end end
Yeonho
  • 3,629
  • 4
  • 39
  • 61
8
votes
2 answers

How to avoid Faraday request to encode get parameters?

I have the following code conn = Faraday.new(:url => 'http://www.mapquestapi.com') do |faraday| faraday.response :logger # log requests to STDOUT faraday.adapter Faraday.default_adapter # make requests with Net::HTTP …
8
votes
3 answers

How disable http logs from Rspec output?

I'm writing tests for my rails application. I want to see only '.' and '*' symbols, when rspec running. But I'm watching HTTP logs and don't know how disable them. Piece of rspec output from my terminal: .............get…
bmalets
  • 3,207
  • 7
  • 35
  • 64
8
votes
3 answers

Rails pagination in API using Her, Faraday

I've been trying to figure this out all day, and it's driving me crazy. I have two rails apps, ServerApp and ClientApp. ClientApp gets data from ServerApp through an API, using the Her gem. Everything was great until I needed pagination…
d3vkit
  • 1,942
  • 1
  • 24
  • 36
1
2 3
18 19