Skip to main content

Questions tagged [faraday]

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

0 votes
0 answers
17 views

Elasticsearch::Transport::Transport::Errors::Forbidden: [403] {"message":"The request signature we calculated does not match signature you provided

require "faraday_middleware/aws_signers_v4" class AmazonElasticSearchClient def self.client return Elasticsearch::Client.new(url: ENV["AWS_ELASTICSEARCH_URL"]) do |f| ...
Arjad Gohar's user avatar
0 votes
0 answers
39 views

Custom Header Type using Hashes using Faraday

I am using the Faraday gem: https://github.com/lostisland/faraday I am trying to create a simple custom filter in the request header and can't seem to parse the values correctly: url = "https://...
user3007294's user avatar
0 votes
0 answers
64 views

Can a request be made with Faraday through an insecure HTTPS proxy?

I have a proxy server that has a self-signed certificate only, and I would like to configure Faraday to make requests through that proxy server over HTTPS. A request can be made with cURL to test that ...
Fazakas Istvan's user avatar
0 votes
0 answers
63 views

Error WebMock::NetConnectNotAllowedError in testing with stub using minitest in rails (using Faraday)

I'm trying to create a test to check the correct behaviout of my service object, def api_call_post(connection, message, url) pp message response = connection.post do |conn| conn.url url ...
Jose Joaquin's user avatar
0 votes
2 answers
294 views

Ruby on Rails 7 - Getting a Failed to open TCP connection to localhost:9200 (Connection refused - connect(2) for 127.0.0.1:9200)

I am using WSL and the Ubuntu app. I am using the searchkick and elasticsearch gems. I have TomSelect installed as well. Ruby on Rails 7. ISSUES: When I type: sudo service elasticsearch start I get: ...
Monroe Mann's user avatar
0 votes
1 answer
38 views

Can not move file to another folder after Faraday::UploadIO telegram api

I iterate the folder with images and if they don't fit the file size, I compress them and send the compressed version as a photo and the uncompressed version as a file. Then I wanted to move the ...
Alefi's user avatar
  • 1
0 votes
0 answers
56 views

Faraday how to get returned parameter from a POST and update record?

When a record is created in rails I am calling a Faraday rest post to a service. This service will return a ticketid of the newly created ticket. I want to then update the rails record with the ...
spacerobot's user avatar
0 votes
1 answer
123 views

Is there a way to serialize and deserialize a Faraday::Response without loosing any information?

I am trying to serialize a Faraday::Response instance without losing any information. I found the marshal_dump and marshal_load methods but they don't seem to keep the response.env.request details. ...
Shiyason's user avatar
  • 781
1 vote
0 answers
387 views

How to modify Faraday middleware configuration on a per-request basis?

I've got some well-configured Faraday client: client = Faraday.new(url: base_url) do |f| f.request :retry, { max: 3, backoff_factor: 2 } f.request :authorization, 'Bearer', -> { access_token } ...
Narfanator's user avatar
  • 5,733
0 votes
2 answers
136 views

is there a way to run two versions of the same gem within the same gem env

In my Gemfile I need gem lumberg and gem openai_chatgpt which both depend on gem faraday. However, lumberg depends on faraday pre v 2.0 and openai_chatgpt depends on faraday post v 2.0. Faraday 2.0+ ...
willyab's user avatar
  • 181
0 votes
1 answer
2k views

Faraday Response is never JSON

I can never get a JSON response from Faraday, within Ruby 3.1.3 and Faraday 2.7.5: def connection @connection ||= Faraday.new( url: url, headers: headers ) do |faraday| ...
I. Khan's user avatar
  • 189
0 votes
2 answers
287 views

how save image using faraday

I have author class using active storage. class Author < ApplicationRecord has_one_attached :image end Here is my faraday connection conn =...
Kashiftufail's user avatar
  • 10.9k
1 vote
1 answer
266 views

"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::...
Matt S.'s user avatar
  • 65
0 votes
1 answer
229 views

How to customize stub request using Faraday?

I'm trying to customize stubs via Faraday and have a little problem with setting request_body and request_headers. All test works and are green, but I'm still getting message by Rubymine: „Found extra ...
Pavel's user avatar
  • 15
0 votes
1 answer
745 views

Rails upload pdf file via POST request

In my Rails 7 app third party API require to send the PDF file created by my application. I've got sample curl from the API docs: curl -X POST --header 'Content-Type: multipart/form-data' --header '...
tajfun_88's user avatar

15 30 50 per page
1
2 3 4 5
19