Announcing the release of http-client

/ racket, package, english

I’m writing this post to announce the release of a new Racket Package called http-client, the source code of it is at:

As a seasoned Ruby developer, when I’m coding to do http requests with Racket lang, I’m always missing a tool like Faraday, which was designed by trying not to hide the principal tech details of the HTTP protocol, and hence it has the ability to make the language level coding feel smoother if you are already familiar with HTTP protocol.

Although there has already been lots of http client in the Racket world, but as my research it seems none of them match the idea I mentioned above.

So after a few days of work, here am I announcing another http client for Racket, that is just simply called http-client.

A piece of code demonstrate the basic usage of it shown below:

(require http-client)
(http-get ""
          #:path "anything/fruits"
          #:data (hasheq 'color "red" 'made-in "China" 'price 10)
          #:headers (hasheq 'Accept "application/json" 'Token "temp-token-abcef"))
(define httpbin-org
    (http-connection ""
                     (hasheq 'Accept "application/json")
                     (hasheq 'made-in "China" 'price 10)))
(http-bin-org 'get
              #:path "/fruits"
              #:data (hasheq 'color "red")
              #:headers (hasheq 'Token "temp-token-abcef"))
(http-post httpbin-org
           #:data (hasheq 'color "red")
           #:path "/fruits"
           #:headers (hasheq 'Token "temp-token-abcef"))

As you can see from the code demonstration, you can do the request in many flexible ways, both with defining a http-connection struct instance and directly using the url string as an arg of the function http-get. More docs please check the doc link on github repo page.

If you are interested to contribute to this pkg and maybe you’ve just found some bugs, please go to the github repo page and create an issue or PR.