Response

body

instantiate

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

gets the body property of a Response.

client-error?

defn

(Fn [(Ref Response a)] Bool)

                        (client-error? r)
                    

checks whether the status code is between 400 and 500.

code

instantiate

(Fn [(Ref Response a)] (Ref Int a))

gets the code property of a Response.

cookies

instantiate

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

gets the cookies property of a Response.

copy

instantiate

(Fn [(Ref Response a)] Response)

copies a Response.

delete

instantiate

(Fn [Response] ())

deletes a Response. Should usually not be called manually.

headers

instantiate

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

gets the headers property of a Response.

init

instantiate

(Fn [Int, String, String, (Array Cookie), (Map String (Array String)), String] Response)

creates a Response.

message

instantiate

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

gets the message property of a Response.

ok?

defn

(Fn [(Ref Response a)] Bool)

                        (ok? r)
                    

checks whether the status code is less than 400.

parse

defn

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

                        (parse txt)
                    

parses a HTTP response from a string txt.

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

prn

instantiate

(Fn [(Ref Response a)] String)

converts a Response to a string.

server-error?

defn

(Fn [(Ref Response a)] Bool)

                        (server-error? r)
                    

checks whether the status code is between 500 and 600.

set-body

instantiate

(Fn [Response, String] Response)

sets the body property of a Response.

set-body!

instantiate

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

sets the body property of a Response in place.

set-code

instantiate

(Fn [Response, Int] Response)

sets the code property of a Response.

set-code!

instantiate

(Fn [(Ref Response a), Int] ())

sets the code property of a Response in place.

set-cookies

instantiate

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

sets the cookies property of a Response.

set-cookies!

instantiate

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

sets the cookies property of a Response in place.

set-headers

instantiate

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

sets the headers property of a Response.

set-headers!

instantiate

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

sets the headers property of a Response in place.

set-message

instantiate

(Fn [Response, String] Response)

sets the message property of a Response.

set-message!

instantiate

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

sets the message property of a Response in place.

set-version

instantiate

(Fn [Response, String] Response)

sets the version property of a Response.

set-version!

instantiate

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

sets the version property of a Response in place.

str

defn

(Fn [(Ref Response a)] String)

                        (str r)
                    

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

update-body

instantiate

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

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

update-code

instantiate

(Fn [Response, (Ref (Fn [Int] Int a) b)] Response)

updates the code property of a Response using a function f.

update-cookies

instantiate

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

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

update-headers

instantiate

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

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

update-message

instantiate

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

updates the message property of a Response using a function f.

update-version

instantiate

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

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

version

instantiate

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

gets the version property of a Response.