# httpc
<a href=""><img src="" alt="GitHub release"></a>
<a href=""><img src="" alt="Discord chat"></a>

Bindings to Erlang's built in HTTP client, `httpc`.

**Note:** HTTPC does not verify TLS connections by default. Your connection may
not be secure with this library. If you're looking for a more full featured
Erlang HTTP client you should take a look at

import gleam/httpc
import gleam/http.{Get}
import gleam/http/request
import gleam/http/response
import gleeunit/should

pub fn main() {
  // Prepare a HTTP request record
  let request =
    |> request.set_method(Get)
    |> request.set_host("")
    |> request.set_path("/hello/world")
    |> request.prepend_header("accept", "application/vnd.hmrc.1.0+json")

  // Send the HTTP request to the server
  try resp = httpc.send(req)

  // We get a response record back
  |> should.equal(200)

  |> response.get_header("content-type")
  |> should.equal(Ok("application/json"))

  |> should.equal("{\"message\":\"Hello World\"}")


## Installation

gleam add gleam_httpc