Questions tagged [httpoison]

for questions related to the HTTP client for Elixir

Yet Another HTTP client for Elixir powered by hackney

https://hex.pm/packages/httpoison


Maintainers

Eduardo Gurgel Pinho

Links

License

MIT

60 questions
0
votes
0 answers

HTTPoison using wrong base URL when calling multiple endpoints from different domains

I have the following function in one module: def create_chart(data) do url = "https://quickchart.io/chart/create" case HTTPoison.post!( url, data, [ {"Content-Type", "application/json"} …
Nightwolf
  • 4,495
  • 2
  • 21
  • 29
0
votes
1 answer

How to send http request to Stripe instead of curl request?

I can send curl request to Stripe API successfully, just like this: curl https://api.stripe.com/v1/customers?limit=3 \ -u sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx: \ -G How can I do with Elixir dependency: HTTPoison, to send an HTTP request?
pengfei xu
  • 29
  • 1
  • 4
0
votes
1 answer

HTTPoison sock5 proxy

I’m using HTTPoison to send HTTP requests through a proxy, but when I change the proxy’s port, HTTPoison doesn’t seem to automatically adapt: iex(1)> HTTPoison.get! "http://httpbin.org/ip", %{}, [proxy: {:socks5,'127.0.0.1',…
stolmen
  • 3
  • 2
0
votes
1 answer

How to make async requests using HTTPoison?

Background We have an app that deals with a considerable amount of requests per second. This app needs to notify an external service, by making a GET call via HTTPS to one of our servers. Objective The objective here is to use HTTPoison to make…
Flame_Phoenix
  • 16,489
  • 37
  • 131
  • 266
0
votes
1 answer

Wait until all data is loaded from Webpage in HTTPoison

I'm trying to load a webpage, where the data I'm interested in is loaded via Ajax after the initial page load. When I fetch the page, the text I currently see is Loading records.... I'm wondering what techniques I can use to wait until that section…
Pete J
  • 53
  • 6
0
votes
1 answer

erlang elixir nif char* data to binary fails for OCSP request

I am trying to create OCSP request to provider with data returned from nif I want make request in this way: HTTPoison.post!( oscp_info[:access], :unicode.characters_to_binary(oscp_info[:data], utf8), [{"Content-Type",…
Maryna Shabalina
  • 450
  • 3
  • 15
0
votes
1 answer

Elixir "case clause error" while pattern matching HTTPoison response

I'm using Httpoison to perform a get request and I want to pattern match the response using a case statement. Here is the code: def current() do case HTTPoison.get!(@api_url) do {:ok, %HTTPoison.Response{body: body, status_code: 200}}…
Frederick John
  • 517
  • 2
  • 6
  • 14
0
votes
2 answers

Testing Elixir/Phoenix Service modules

I've been playing around with Elixir/Phoenix third-party modules. ( Modules that are used to fetch some data from a 3rd party service ) One of those module looking like so: module TwitterService do @twitter_url "https://api.twitter.com/1.1" def…
dev-cyprium
  • 758
  • 2
  • 8
  • 25
0
votes
2 answers

Phoenix/Elixir - cURL works, but HTTPoison fails

In my Phoenix app, I am trying to use the HTTPoison HTTP client (https://hexdocs.pm/httpoison/api-reference.html) to make a post request to the AgileCRM API. I was able to use cURL to make a successful request, but my attempt to replicate it in…
skwidbreth
  • 7,888
  • 11
  • 58
  • 105
0
votes
1 answer

Making a HTTPoison POST multipart request with more data other than the file

I'm trying to build a function to send a file through a POST request in multipart format, using this as guide, but HTTPoison keeps giving me two errors no matter what changes I make to the form. They are…
Besto
  • 388
  • 1
  • 13
0
votes
1 answer

No Matching Action Clause to Process Request error on HTTPoison.patch

From an elixir genserver process I am executing the post_metdata method to send a JSON HTTP Patch request to a Phoenix endpoint (on another server). The server continues to error indicating no matching clause showing the JSON link structure is not…
Bill Christian
  • 689
  • 1
  • 6
  • 16
0
votes
0 answers

Elixir HTTPoison no case clause matching: false error

I’m currently trying to build a simple HTTP service in Elixir that queries a web services (SOAP) API using HTTPoison via a proxy. This is what my code looks like: defp body do """
gosseti
  • 965
  • 16
  • 40
0
votes
1 answer

Incorrect Mpeg file format after being transferred by Elixir/HTTPoison

Following my (dumb) question and reading this I managed to connect to my cam, get the flow from it and dump it into an mpeg file. Here is the code for more clarity. test "request headers from cam" do options = [basic_auth:…
Tanc
  • 667
  • 3
  • 6
  • 25
0
votes
1 answer

How to get a video flow with Elixir/HTTPoison or Hackney?

I'm trying to get a stream from a cam using Elixir / HTTPoison and dump it into a file. Url is x.x.x.x/axis-cgi/mjpg/video.cgi?duration=1&resolution=320x240 Using the url in DHC (Chrome addon), i can have the following: Response 200 OK HEADERS…
Tanc
  • 667
  • 3
  • 6
  • 25
0
votes
1 answer

Return JSON after REST call in Phoenix endpoint

I am learning Elixir and Phoenix, I'm building a side project that needs to query Github's APIs. This is the module that performs the call defmodule Github do use HTTPoison.Base def process_url(url) do "https://api.github.com/" <> url …
Alberto Zaccagni
  • 30,779
  • 11
  • 72
  • 106
1 2 3
4