Skip to content

carpentry-org/http

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 

Repository files navigation

http

HTTP for Carp, expressed as a parser and a data structure.

Installation

(load "[email protected]:carpentry-org/[email protected]")

Usage

Currently, all you can do is parse and build HTTP requests and responses, by using Request.parse and Response.parse.

Hopefully you’ll soon be able to do more than that!

(load "[email protected]:carpentry-org/[email protected]")

(def txt "POST / HTTP/1.1\r
Host: https://veitheller.de\r
User-Agent: curl/7.54.0\r
Accept: */*\r
\r
hi!")

(defn main []
  (let [x (Request.parse txt)]
    (match x
      (Result.Success r) (println* &r)
      (Result.Error e)   (println* &e))))

Have fun!

About

A HTTP library for Carp

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published