chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] rest-bind request headers support


From: Andy Bennett
Subject: Re: [Chicken-users] rest-bind request headers support
Date: Sun, 29 Mar 2015 13:37:00 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0

Hi,

Thanks Kooda!

I seem to have noticed this too but didn't actually push my changes!
Our patches are very similar but mine respects the entire request object
if passed by the user.

Please can you try it and let me know if it works for you?
The repository is at ssh://address@hidden/knodium/rest-bind.git

If it works then I'll cut a release, if not I'll apply your patch
instead and cut a release.


Thanks for reporting this and doing the work to find out what was wrong!

:-)

I hope you're enjoying rest-bind.


> 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)
> 





Regards,
@ndy

-- 
address@hidden
http://www.ashurst.eu.org/
0290 DA75 E982 7D99 A51F  E46A 387A 7695 7EBA 75FF




reply via email to

[Prev in Thread] Current Thread [Next in Thread]