From 6156a9ef7be4012063a042aafb4e9b0d7eadde8e Mon Sep 17 00:00:00 2001 From: "H.J" Date: Wed, 9 Oct 2024 11:35:09 -0400 Subject: cleanup --- aoc2023/build/packages/gleam_httpc/README.md | 52 ---------------------------- 1 file changed, 52 deletions(-) delete mode 100644 aoc2023/build/packages/gleam_httpc/README.md (limited to 'aoc2023/build/packages/gleam_httpc/README.md') diff --git a/aoc2023/build/packages/gleam_httpc/README.md b/aoc2023/build/packages/gleam_httpc/README.md deleted file mode 100644 index c2363c5..0000000 --- a/aoc2023/build/packages/gleam_httpc/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# httpc -GitHub release -Discord chat -![CI](https://github.com/gleam-lang/httpc/workflows/test/badge.svg?branch=main) - -Bindings to Erlang's built in HTTP client, `httpc`. - -```gleam -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.new() - |> request.set_method(Get) - |> request.set_host("test-api.service.hmrc.gov.uk") - |> 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 - resp.status - |> should.equal(200) - - resp - |> response.get_header("content-type") - |> should.equal(Ok("application/json")) - - resp.body - |> should.equal("{\"message\":\"Hello World\"}") - - Ok(resp) -} -``` - -## Installation - -```shell -gleam add gleam_httpc -``` - -## Use with Erlang/OTP versions older than 26.0 - -Older versions of HTTPC do not verify TLS connections by default, so with them -your connection may not be secure when using this library. Consider upgrading to -a newer version of Erlang/OTP, or using a different HTTP client such as -[hackney](https://github.com/gleam-lang/hackney). -- cgit v1.2.3