Reputation: 1789
I want to send an HTTP request within Cowboy framework, and read the response’s body. Is there any meta level functionality to do so or I should go down to Erlang to do it? From the document I only see ‘handlers’. Any help is appreciated.
Upvotes: 0
Views: 1039
Reputation: 1449
The cowboy is a Erlang server application but for sending HTTP request you can use libraries like gun, shot or you can use httpc directly out of the box of Erlang.
Upvotes: 1
Reputation: 20993
Cowboy is a web server, it is not a framework. It does not provide HTTP client functionality of sending requests and receiving responses. Its role is opposite, it supports receiving requests from clients and responding to them.
In order to send requests you need HTTP client. In Erlang you can choose among several. httpc is part of Erlang distribution. The team which developed Cowboy also created Gun, an asynchronous HTTP client. There exist several others.
Upvotes: 1