racket/collects/web-server/request-structs.ss
2005-08-25 19:51:28 +00:00

25 lines
751 B
Scheme

(module request-structs mzscheme
(require (lib "contract.ss")
(lib "url.ss" "net"))
;; the request struct as currently doc'd
(define-struct request (method uri headers bindings/raw host-ip client-ip))
;; header?: anyd/c -> boolean
;; is this a header?
(define header?
(cons/c symbol? bytes?))
;; bindings? any/c -> boolean
;; is this a binding
(define binding?
(cons/c symbol?
(union string?
bytes?)))
(provide header? binding?)
(provide/contract
[struct request ([method symbol?] [uri url?] [headers (listof header?)]
[bindings/raw (union (listof binding?) string?)]
[host-ip string?]
[client-ip string?])]))