Questions tagged [httpc]

9 questions
3
votes
1 answer

Stream large http response to disk in Erlang with httpc lib

httpc:request(get, {URL, []}, [], [{stream, FilePath}]) returns {ok, saved_to_file} even when the remote web-service dies midway while streaming the response. I checked the content on the disk was missing a whole bunch of data. Is this a known quirk…
sa___
  • 363
  • 2
  • 12
2
votes
1 answer

httprc:request throws exception exit: {noproc, {gen_server,call, [httpc_manager ...]}}

I want to invoke httprc:request in my erlang program, but I get an exception, which has no information to me, what went wrong. This is my code: print_helloworld() -> Body = "userId=12345", httpc:request(post, { …
Ghostw4lk
  • 127
  • 1
  • 11
2
votes
0 answers

Does the httpc:request option sync block?

httpc_request(Url) -> HttpOpts = [{timeout, 5000}], Opts = [{sync, true}, {full_result, false}, {body_format, binary}], httpc:request(get, {Url, []}, HttpOpts, Opts). In gen_server process p(pid = P), execute function…
Chan
  • 21
  • 1
1
vote
1 answer

How set proxy with username and password for `httpc` library?

I've tried the following without success: :httpc.set_options( proxy: {{'proxy.int.mycompany.com', 8080}, ['localhost'], proxy_auth: {'developer', 'developer'}}) And :httpc.set_options(proxy: { {'proxy.int.mycompany.com', 8080}, ['localhost'],…
arpit
  • 728
  • 7
  • 22
1
vote
1 answer

Elixir httpc error on production

I want to use :httpc as my HTTP client. I use edeliver for my release management and such. I have :inets and :httpc in my .deliver/config.exs like: set applications: [ :runtime_tools, :inets, :httpc ] I also added :inets to…
vfsoraki
  • 2,186
  • 1
  • 20
  • 45
1
vote
1 answer

YAWS responds with errors under light load. "Unhandled reply fr. do_recv() {error,econnaborted}"

Hello fellow Erlangers :) Just another Erlang enthusiast playing with the language here. I have a very simple YAWS app module which works fine when accessed by single clients. However, if I try to span multiple clients to simulate light traffic,…
Piotr Justyna
  • 4,888
  • 3
  • 25
  • 40
0
votes
1 answer

How to unset or remove the proxy option on Erlang httpc client default profile once set?

The proxy originally is not set and shown as undefined: httpc:get_options(all). {ok,[{proxy,{undefined,[]}}, {https_proxy,{undefined,[]}}, {pipeline_timeout,0}, {max_pipeline_length,2}, {max_keep_alive_length,5}, …
casillic
  • 1,837
  • 1
  • 24
  • 29
0
votes
1 answer

webpage returns different status codes at different requests

This is part of code of my project. URL="http://www.amazon.com", HTTPOpts = [{autoredirect, false}], case httpc:request(get, {URL, [{"User-Agent", "Mozilla"}]}, HTTPOpts, []) of {ok, {{_, Code, _}, Headers, Body}} when Code == 200 -> %%code…
Mandeep Singh
  • 308
  • 2
  • 5
  • 18
0
votes
1 answer

Erlang Get the final redirected URL

As given in this question, I used below method for finding the final redirected URL as URL="http://mail.google.com", HTTPOpts = [{autoredirect, false}], perform_request(URL) -> case httpc:request(get, {URL, [{"User-Agent", "Mozilla"}]}, HTTPOpts,…
Mandeep Singh
  • 308
  • 2
  • 5
  • 18