Add PARSE-HTTP-URL-STRING procedure to URL structure.
This commit is contained in:
parent
b85f09212e
commit
e090e1bd44
|
@ -136,6 +136,13 @@
|
|||
|
||||
(make-http-url uh (map unescape-uri (cdddr path)) search frag-id)))
|
||||
|
||||
(define (parse-http-url-string string)
|
||||
(call-with-values
|
||||
(lambda () (parse-uri string))
|
||||
(lambda (scheme path search frag-id)
|
||||
(if (string=? scheme "http")
|
||||
(parse-http-url path search frag-id)
|
||||
(fatal-syntax-error "not an HTTP URL" path)))))
|
||||
|
||||
;;; Default http port is 80.
|
||||
(define default-http-userhost (make-userhost #f #f #f "80"))
|
||||
|
|
|
@ -60,26 +60,27 @@
|
|||
simplify-uri-path))
|
||||
|
||||
(define-interface url-interface
|
||||
(export userhost? ; USERHOST
|
||||
make-userhost ; record struct
|
||||
(export userhost?
|
||||
make-userhost
|
||||
|
||||
userhost-user
|
||||
userhost-password
|
||||
userhost-host
|
||||
userhost-port
|
||||
|
||||
parse-userhost ; parse &
|
||||
userhost->string ; unparse.
|
||||
parse-userhost
|
||||
userhost->string
|
||||
|
||||
http-url? ; HTTP-URL
|
||||
make-http-url ; record struct
|
||||
http-url?
|
||||
make-http-url
|
||||
|
||||
http-url-userhost
|
||||
http-url-path
|
||||
http-url-search
|
||||
http-url-frag-id
|
||||
|
||||
parse-http-url ; parse &
|
||||
parse-http-url
|
||||
parse-http-url-string
|
||||
http-url->string))
|
||||
|
||||
(define-interface ftp-interface
|
||||
|
|
Loading…
Reference in New Issue