racket/collects/web-server/request-structs.ss
Jay McCarthy d97a87bc62 union -> or/c
svn: r2143
2006-02-06 17:35:37 +00:00

26 lines
812 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 host-port 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?
(or/c string?
bytes?)))
(provide header? binding?)
(provide/contract
[struct request ([method symbol?] [uri url?] [headers (listof header?)]
[bindings/raw (or/c (listof binding?) string?)]
[host-ip string?] [host-port number?]
[client-ip string?])]))