savvy v0.1.0 Savvy.HTTP View Source

Implement the HTTP requests

Link to this section Summary

Functions

Issues a GET request to the given url

Link to this section Functions

Link to this function

get(url) View Source
get(bitstring()) :: {:ok, bitstring()} | {:error, bitstring()}

Issues a GET request to the given url.

Examples

iex> Savvy.HTTP.get("httpstat.us/200")
{:ok, "\"200 OK\""}

iex> Savvy.HTTP.get("httpstat.us/400")
{:ok, "\"400 Bad Request\""}

iex> Savvy.HTTP.get("httpstat.us/404")
{:ok, "\"404 Not Found\""}

iex> Savvy.HTTP.get("httpstat.us/500")
{:error, "server error"}