# Fetch

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

Bindings to JavaScript's built in HTTP client, `fetch`.

import gleam/fetch
import gleam/http/request
import gleam/http/response
import gleam/javascript/promise

pub fn main() {
  let assert Ok(req) ="")

  // Send the HTTP request to the server
  use resp <- promise.try_await(fetch.send(req))
  use resp <- promise.try_await(fetch.read_text_body(resp))

  // We get a response record back
  // -> 200

  response.get_header(resp, "content-type")
  // -> Ok("text/html; charset=UTF-8")