Request

body

instantiate

(Fn [(Ref Request a)] (Ref String a))

gets the body property of a Request.

cookies

instantiate

(Fn [(Ref Request a)] (Ref (Array Cookie) a))

gets the cookies property of a Request.

copy

instantiate

(Fn [(Ref Request a)] Request)

copies a Request.

del

defn

(Fn [URI, (Array Cookie), (Map String (Array String)), String] Request)

                        (del uri cookies headers body)
                    

builds a HTTP DELETE request (version 1.1).

delete

instantiate

(Fn [Request] ())

deletes a Request. Should usually not be called manually.

get

defn

(Fn [URI, (Array Cookie), (Map String (Array String)), String] Request)

                        (get uri cookies headers body)
                    

builds a HTTP GET request (version 1.1).

headers

instantiate

(Fn [(Ref Request a)] (Ref (Map String (Array String)) a))

gets the headers property of a Request.

ignore-body?

defn

(Fn [(Ref Request a)] Bool)

                        (ignore-body? r)
                    

checks whether the body of the request should be ignored.

init

instantiate

(Fn [String, String, URI, (Array Cookie), (Map String (Array String)), String] Request)

creates a Request.

parse

defn

(Fn [(Ref String a)] (Result Request String))

                        (parse txt)
                    

parses a HTTP request from a string txt.

Returns an (Error String) holding the error message if it fails, otherwise it will return a (Success Request).

patch

defn

(Fn [URI, (Array Cookie), (Map String (Array String)), String] Request)

                        (patch uri cookies headers body)
                    

builds a HTTP PATCH request (version 1.1).

post

defn

(Fn [URI, (Array Cookie), (Map String (Array String)), String] Request)

                        (post uri cookies headers body)
                    

builds a HTTP POST request (version 1.1).

prn

instantiate

(Fn [(Ref Request a)] String)

converts a Request to a string.

put

defn

(Fn [URI, (Array Cookie), (Map String (Array String)), String] Request)

                        (put uri cookies headers body)
                    

builds a HTTP PUT request (version 1.1).

request

defn

(Fn [String, URI, (Array Cookie), (Map String (Array String)), String] Request)

                        (request verb uri cookies headers body)
                    

builds a HTTP 1.1 request.

set-body

instantiate

(Fn [Request, String] Request)

sets the body property of a Request.

set-body!

instantiate

(Fn [(Ref Request a), String] ())

sets the body property of a Request in place.

set-cookies

instantiate

(Fn [Request, (Array Cookie)] Request)

sets the cookies property of a Request.

set-cookies!

instantiate

(Fn [(Ref Request a), (Array Cookie)] ())

sets the cookies property of a Request in place.

set-headers

instantiate

(Fn [Request, (Map String (Array String))] Request)

sets the headers property of a Request.

set-headers!

instantiate

(Fn [(Ref Request a), (Map String (Array String))] ())

sets the headers property of a Request in place.

set-uri

instantiate

(Fn [Request, URI] Request)

sets the uri property of a Request.

set-uri!

instantiate

(Fn [(Ref Request a), URI] ())

sets the uri property of a Request in place.

set-verb

instantiate

(Fn [Request, String] Request)

sets the verb property of a Request.

set-verb!

instantiate

(Fn [(Ref Request a), String] ())

sets the verb property of a Request in place.

set-version

instantiate

(Fn [Request, String] Request)

sets the version property of a Request.

set-version!

instantiate

(Fn [(Ref Request a), String] ())

sets the version property of a Request in place.

str

defn

(Fn [(Ref Request a)] String)

                        (str r)
                    

stringifies the request. It should be stringified exactly as it looks on the wire.

update-body

instantiate

(Fn [Request, (Ref (Fn [String] String a) b)] Request)

updates the body property of a Request using a function f.

update-cookies

instantiate

(Fn [Request, (Ref (Fn [(Array Cookie)] (Array Cookie) a) b)] Request)

updates the cookies property of a Request using a function f.

update-headers

instantiate

(Fn [Request, (Ref (Fn [(Map String (Array String))] (Map String (Array String)) a) b)] Request)

updates the headers property of a Request using a function f.

update-uri

instantiate

(Fn [Request, (Ref (Fn [URI] URI a) b)] Request)

updates the uri property of a Request using a function f.

update-verb

instantiate

(Fn [Request, (Ref (Fn [String] String a) b)] Request)

updates the verb property of a Request using a function f.

update-version

instantiate

(Fn [Request, (Ref (Fn [String] String a) b)] Request)

updates the version property of a Request using a function f.

uri

instantiate

(Fn [(Ref Request a)] (Ref URI a))

gets the uri property of a Request.

verb

instantiate

(Fn [(Ref Request a)] (Ref String a))

gets the verb property of a Request.

version

instantiate

(Fn [(Ref Request a)] (Ref String a))

gets the version property of a Request.