[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] rest-bind request headers support
From: |
Kooda |
Subject: |
[Chicken-users] rest-bind request headers support |
Date: |
Sun, 29 Mar 2015 00:50:33 +0100 |
User-agent: |
Mutt/1.5.23.1-rc1 (2014-03-12) |
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.000000000 +0100
+++ rest-bind.scm 2015-03-29 00:24:43.000000000 +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] rest-bind request headers support,
Kooda <=