crow/io/net/http-types.crow (source)

http-request record

Parsed HTTP request.

body string(a http-request)

body-json json(a http-request)

cookies alias

parse-cookies symbol[string](a http-request)

set-cookie-header (symbol, string) tuple2(cookies symbol[string])

cookies-string string(cookies symbol[string])

http-response record

Response to an HTTP request.

respond-error record exception variant-member

to http-response(a respond-error)

show string(a respond-error)

http-bad-query exception()

Creates a 400 response with the message "Bad query".

http-bad-query exception(message string)

Creates a 400 response with the given message.

http-forbidden exception()

Creates a 403 response with the message "Forbidden".

http-forbidden exception(message string)

Creates a 403 response with the given message.

http-not-found exception()

Creates a 404 response with the message "Not found".

http-not-found exception(message string)

Creates a 404 response with the given message.

http-internal-server-error respond-error()

http-ok http-response()

Creates a 200 response with the message "OK".

http-ok http-response(content json)

Creates a 200 response with the given message.

http-ok http-response(message string)

http-ok http-response(content json, headers symbol[string])

http-ok http-response(message string, headers symbol[string])

Creates a 200 response with the given message and headers.

http-method enum

  • GET
  • POST

Method used by an HTTP request.

show string(a http-method)