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

55 questions
9
votes
2 answers

How to add a trusted certificate to HTTPPoison/hackney?

When I try: HTTPoison.get! "https://facebook.com" I get: ** (HTTPoison.Error) {:tls_alert, 'unknown ca'} [error] SSL: :certify: ssl_handshake.erl:1606:Fatal error: unknown ca (httpoison) lib/httpoison.ex:66: HTTPoison.request!/5 which is kind…
diogovk
  • 1,846
  • 16
  • 21
5
votes
1 answer

Get the count of pool

I’m using HTTPoison and Hackney pools: :hackney_pool.child_spec(:start, [checkout_timeout: ..., max_connections: 100]), :hackney_pool.child_spec(:trigger, [checkout_timeout: ..., max_connections: 100]), :hackney_pool.child_spec(:result,…
Orange-Man
  • 129
  • 8
4
votes
1 answer

HTTPoison.request!/5 raises %HTTPoison.Error with weird reason

After upgrading to Elixir 1.10.3, a call to HTTPoison.request!() raised a HTTPoison.Error with id: nil and a reason of {:options, {:sslv3, {:versions, [:"tlsv1.2", :"tlsv1.1", :tlsv1, :sslv3]}}}. What could cause this? All examples I've seen online…
bigblind
  • 11,435
  • 13
  • 61
  • 111
4
votes
1 answer

Elixir fetching metadata from shoutcast

I want to make a program which will display currently playing songs from an internet radio stream(SomaFM). I am using HTTPoison library in Elixir. But I am failing to get a response. It just hangs. I am using the following code: HTTPoison.start url…
aeroith
  • 99
  • 2
  • 5
3
votes
2 answers

HTTPoison manually close connection

This is a very simple module that keeps checking the requester's IP. I use backconnect proxies which means that it gets new IP on every http request. defmodule Test do def go() do Enum.each(1..1, fn x -> …
Nema Ga
  • 1,940
  • 3
  • 17
  • 39
3
votes
1 answer

HTTP 1.0 request with HTTPoison

How do I make a HTTP/1.0 request with HTTPoison? I don't know which version it's using, but I'm assuming it's not 1.0 by default. I am integrating with some accounting software called MoneyWorks, and they recommend using HTTP/1.0 if possible to…
Peter Brown
  • 48,818
  • 16
  • 106
  • 142
2
votes
3 answers

HTTPoison request failes on specific machine but works in another machine

Am doing a post with HTTPoison, on one machine everything works well, but in the other the same code, with similar environment parameters. HTTPoison.post!("https://remote_api", "", [{"X-TOKEN", System.get_env("API_TOKEN"}, {"Content-Type",…
Ricoh
  • 29
  • 7
2
votes
1 answer

iex> how to import HTTPoison

I'm new to Elixir. I was hoping it would be similar to Python or R where modules can be downloaded and kept up-to-date without too much effort. I have already created a mix project to use HTTPoison but I really just want to try out HTTPoison from…
AG1
  • 6,428
  • 8
  • 35
  • 54
2
votes
2 answers

HTTPoison ArgumentError on Phoenix mix task

I have mix task mix fetch.btc on phoenix app (lib/mix/tasks/fetch.btc.ex): defmodule Mix.Tasks.Fetch.Btc do use Mix.Task def run(_args) do res = HTTPoison.get!("https://blockchain.info/ticker") IO.inspect(res) end end When I run mix…
Alexey Egorov
  • 1,581
  • 1
  • 13
  • 20
2
votes
1 answer

Use HTTPoison to initialize a module attribute

I am trying to do initialize a module attribute like this response = HTTPoison.get! url {:ok, response} = Poison.decode(response.body) @attr response I have done it before with a file, something like this: @external_resource file =…
lapinkoira
  • 6,688
  • 7
  • 36
  • 74
2
votes
1 answer

HTTPoison to make a post request with Authorization in header.

I am trying to make a http post request with HTTPoison. I want to pass json data with header, which contains "Authorization": Bearer #{token}. In order to achieve that, I have tried, headers = [{"Authorization": "Bearer #{token}"}, {"Content-Type",…
D.R
  • 689
  • 2
  • 13
  • 27
2
votes
1 answer

Send HTTPS get requests to same host but different host ips

I would like to send HTTPS requests to the same host but I would like to choose the target IP every time. For example "dig digitalocean.com" shows these IPs: digitalocean.com. 300 IN A 104.16.110.208 digitalocean.com. 300 IN A …
Barna Kovacs
  • 1,143
  • 1
  • 10
  • 34
2
votes
1 answer

httpoison - response body showing garbled text instead of html

If I try: url = "https://www.economist.com/news/finance-and-economics/21727073-economists-struggle-work-out-how-much-free-economy-comes-cost" {:ok, %HTTPoison.Response{status_code: 200, body: body}} = HTTPoison.get(url) IO.binwrite body I see…
tldr
  • 10,743
  • 11
  • 69
  • 111
2
votes
1 answer

Access Azure Storage Services REST API with Elixir and HTTPoison

I'm trying to use Elixir to access Azure Storage Services via their REST API but I'm having difficulty getting the Authentication Header to work. I am able to connect if I use the ex_azure package (wrapper for erlazure) but not when I try to build…
dwyd
  • 55
  • 2
  • 9
2
votes
0 answers

%HTTPoison.Error{id: nil, reason: :closed}

We are using HTTPoison in our code base for the post and get requests while using the hackney pool. Posting here is just because I want to get some opinions from all the experts. We are working with a lot of cameras, where, from each camera, we are…
Junaid Farooq
  • 2,010
  • 3
  • 15
  • 44
1
2 3 4