Response
client-error?
(Fn [(Ref Response a)] Bool)
(client-error? r)
checks whether the status code is between 400 and 500.
cookies
(Fn [(Ref Response a)] (Ref (Array Cookie) a))
gets the cookies
property of a Response
.
headers
(Fn [(Ref Response a)] (Ref (Map String (Array String)) a))
gets the headers
property of a Response
.
init
(Fn [Int, String, String, (Array Cookie), (Map String (Array String)), String] Response)
creates a Response
.
parse
(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)
.
server-error?
(Fn [(Ref Response a)] Bool)
(server-error? r)
checks whether the status code is between 500 and 600.
set-body!
(Fn [(Ref Response a), String] ())
sets the body
property of a Response
in place.
set-code!
(Fn [(Ref Response a), Int] ())
sets the code
property of a Response
in place.
set-cookies
(Fn [Response, (Array Cookie)] Response)
sets the cookies
property of a Response
.
set-cookies!
(Fn [(Ref Response a), (Array Cookie)] ())
sets the cookies
property of a Response
in place.
set-headers
(Fn [Response, (Map String (Array String))] Response)
sets the headers
property of a Response
.
set-headers!
(Fn [(Ref Response a), (Map String (Array String))] ())
sets the headers
property of a Response
in place.
set-message!
(Fn [(Ref Response a), String] ())
sets the message
property of a Response
in place.
set-version!
(Fn [(Ref Response a), String] ())
sets the version
property of a Response
in place.
str
(Fn [(Ref Response a)] String)
(str r)
stringifies the request. It should be stringified exactly as it looks on the wire.
update-body
(Fn [Response, (Ref (Fn [String] String a) b)] Response)
updates the body
property of a Response
using a function f
.
update-code
(Fn [Response, (Ref (Fn [Int] Int a) b)] Response)
updates the code
property of a Response
using a function f
.
update-cookies
(Fn [Response, (Ref (Fn [(Array Cookie)] (Array Cookie) a) b)] Response)
updates the cookies
property of a Response
using a function f
.
update-headers
(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
(Fn [Response, (Ref (Fn [String] String a) b)] Response)
updates the message
property of a Response
using a function f
.
update-version
(Fn [Response, (Ref (Fn [String] String a) b)] Response)
updates the version
property of a Response
using a function f
.