On this page:
header
headers-assq
headers-assq*
binding
binding: form
binding: file
bindings-assq
request
Version: 4.1

2.3 HTTP Requests

 (require web-server/private/request-structs)

"private/request-structs.ss" provides a number of structures and functions related to HTTP request data structures.

(struct

 

header

 

(field value))

  field : bytes?

  value : bytes?

Represents a header of field to value.

(headers-assq id heads)  (or/c false/c header?)

  id : bytes?

  heads : (listof header?)

Returns the header with a field equal to id from heads or #f.

(headers-assq* id heads)  (or/c false/c header?)

  id : bytes?

  heads : (listof header?)

Returns the header with a field case-insensitively equal to id from heads or #f.

(struct

 

binding

 

(id))

  id : bytes?

Represents a binding of id.

(struct

 

(binding:form binding)

 

(value))

  value : bytes?

Represents a form binding of id to value.

(struct

 

(binding:file binding)

 

(filename content))

  filename : bytes?

  content : bytes?

Represents the uploading of the file filename with the id id and the content content.

(bindings-assq binds)  (or/c false/c binding?)

  binds : (listof binding?)

Returns the binding with an id equal to id from binds or #f.

(struct

 

request

 (

method

 

 

 

 

uri

 

 

 

 

headers/raw

 

 

 

 

bindings/raw

 

 

 

 

post-data/raw

 

 

 

 

host-ip

 

 

 

 

host-port

 

 

 

 

client-ip))

  method : symbol?

  uri : url?

  headers/raw : (listof header?)

  bindings/raw : (listof binding?)

  post-data/raw : (or/c false/c bytes?)

  host-ip : string?

  host-port : number?

  client-ip : string?

An HTTP method request to uri from client-ip to the server at host-ip:host-port with headers/raw headers, bindings/raw GET and POST queries and post-data/raw POST data.