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
2
votes
1 answer

Farad​ay Timeout error ReadTimeout when sending user data to remote webserver

Problem: I'm experiencing the following error from Faraday when I'm posting data to our Remote web service. This error is occurring at random occasions with random users. Error: Farad​ay::E​rror:​:Time​outEr​ror: ​Net::​ReadT​imeou​t More…
FastSolutions
  • 1,809
  • 1
  • 25
  • 49
2
votes
1 answer

Faraday POST request to getpocket API

I'm trying to set up OAuth for users of my Rails app to GetPocket (http://getpocket.com). On Step 2 of the Pocket Authentication docs (http://getpocket.com/developer/docs/authentication), I'm having trouble constructing the exact Faraday…
tanookiben
  • 22,575
  • 8
  • 27
  • 25
2
votes
1 answer

Rails - Sending image using Faraday

I'm trying to make a request to an API sending an image and some other data, and getting the response. That's my code: file = "assets/images/test.jpg" conn = Faraday.new(:url => "api_url" ) do |faraday| faraday.request :multipart end payload = {…
user1573607
  • 522
  • 9
  • 23
2
votes
2 answers

Using Capistrano and error occurs during execution of cap deploy

I'm using Capistrano to help deploy a Rails project and when I run the command cap deploy I get the following error produced below. Anyone have an idea what's going wrong? Here is the error that is being generated when it's trying to execute the…
Petesta
  • 1,623
  • 3
  • 19
  • 29
2
votes
0 answers

How to use delayed job in rails observer with faraday

With the app I'm building, we're using trumpia to schedule and send sms, and email messages to our users. When they sign up, I'm using an observer to trigger the call to trumpia, and I'm using faraday to actually connect with the trumpia API. My…
xcskier56
  • 611
  • 3
  • 11
2
votes
4 answers

work around Ruby's broken URI.parse, follow redirects

I am using Ruby to scrape webpages that sometimes return redirects which I want to follow. There is many Ruby gems that do that, but there is a problem: Ruby's URI.parse explodes on some URIs that are technically invalid but work in browsers like…
levinalex
  • 5,889
  • 2
  • 34
  • 48
2
votes
1 answer

Getting Faraday::Error::ConnectionFailed when connecting from heroku rails app

My company has a simple oauth server at https://auth.vitalvu.com I'm developing a rails app that needs to make requests to that server (via the omniauth-oauth2 gem). When I try to run the app on Heroku I get the…
phaedryx
  • 2,024
  • 3
  • 16
  • 24
2
votes
3 answers

Omniauth + Google + Faraday + Behind the proxy = how setup proxy?

My production server is Ubuntu 12. I'm using Devise + OmniAuth to handle the Google authentication. But when Google returns a control to my application I get an error "Network is unreachable". I assume it's because of server is behind the proxy. …
Lesha Pipiev
  • 3,251
  • 4
  • 31
  • 65
2
votes
2 answers

What's the best way to stub out network calls with Faraday in the Balanced Ruby client?

I'm not particularly familiar with Faraday's stubbing API, but from a casual inspection of that and the source of Balanced::Client, it looks like I'd need to be able to provide my own value for Balanced::Client.conn. This is a step towards…
Brian Moseley
  • 138
  • 1
  • 7
2
votes
1 answer

How to set cookie in faraday

I'm using Faraday as an HTTP client to test my HTTP service (based on Sinatra). It's very powerful for me, but I have a problem. We track sessions on the Sinatra service, but I cannot set the cookie value with the Faraday client. This is the sample…
fsword
  • 1,505
  • 2
  • 10
  • 8
2
votes
1 answer

Faraday conflicts in google_drive and google-api-client

I'd like to be able to use both the google-api-client gem to do service to service authentication and the google_drive api to access spreadsheets. Unfortunately, these gems seem to conflict due to requiring different versions of Faraday in their…
1
vote
1 answer

Faraday (Ruby) Timeout Errors

I'm attempting to put a small payload generated in route A (Sinatra app) to Route B using Faraday. So the code basically looks like: post "/routeA" do foo.save foo_id = foo.id conn = Faraday.new(:url => "http://localhost:3001/routeB" ) do…
Foot
  • 449
  • 4
  • 13
1
vote
1 answer

"Faraday::ConnectionFailed: Broken pipe" when uploading Tempfile to S3 Presigned URL

In my Ruby on Rails application, I need to upload large (~30MB or greater) MP4 video assets to an Amazon S3 Presigned URL using the Faraday Ruby gem. This operation frequently fails with a Faraday::ConnectionFailed: Broken pipe error. I want to…
1
vote
1 answer

Faraday::ConnectionFailed when using elastic search in rails using docker

I'm trying to make a search function in message model and evrey thing works well without docker but when compile the whole stack using docker it gives me "status": 500, "error": "Internal Server Error", "exception": "#
1
vote
0 answers

wrong number of arguments (given 2, expected 0..1) with Faraday post request

I'm trying to send http post request from my application using faraday gem, but I keep receiving this error wrong number of arguments (given 2, expected 0..1) in that line response = connection.post '/submissions' do |request| and here is my…