Hi,
I’m trying to use rest-bind for a project and need to be able to add
some headers to the http requests, which rest-bind didn’t permit, even
when passing a request object.
Here is a simple patch that fixes this issue:
--- rest-bind.scm.orig 2015-03-29 00:26:49.0 +0100
+++ rest-bind.scm 2015-03-29 00:24:43.0 +0100
@@ -94,7 +94,9 @@
(else (uri-reference uri/req
(method (cond ((request? uri/req) (request-method
uri/req))
(writer 'POST)
- (else 'GET
+ (else 'GET)))
+ (headers (cond ((request? uri/req) (request-headers
uri/req))
+ (else (headers '())
(lambda ,proc-args
(let* (,@(if (not (null? uri-args))
`((uri (update-uri uri path: (append (uri-path
uri) (map -string (list ,@uri-args)
@@ -109,7 +111,7 @@
,param)))
params))
'())
- (req (make-request uri: uri method: method)) ; poke
the args into query string.
+ (req (make-request uri: uri method: method headers:
headers)) ; poke the args into query string.
)
(receive (reader uri response)
(call-with-input-request req ,(if writer
'(writer body) #f) ,reader)
--
Envoyé depuis ma GameBoy.
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users