[hunchentoot-devel] Re: Hunchentoot REST framework

Edi Weitz edi at agharta.de
Tue May 29 18:25:45 UTC 2007


Hi,

On Tue, 29 May 2007 15:35:58 +0200, Nicolas Lamirault <lam at tuxfamily.org> wrote:

> i'm re-working on this framework and i've got a few problems ... 

I'd prefer if we could continue this discussion on the mailing list -
see Cc.

> i try to get parameters when a make a PUT request :
>
> $> curl -X PUT -d name=nicolas  http://localhost:8888/ht-rest/test/user/lam@foo.org

If you use curl like this, it will send the parameters as
application/x-www-form-urlencoded in the request body.  I can't see
how it would make sense to use a PUT request for this.  In a PUT
request, the request body is supposed to be the entity that is to be
stored under the request URI.

> on logs i have this :
>
> [2007-05-29 15:30:19 [INFO]] Put User
> [2007-05-29 15:30:19 [INFO]] PUT parameters NIL

Where do these log entries come from?

> and i create a function :
>
> (defun rest-put-parameter (name)
>   "Returns the value of the PUT  parameter named by the string NAME as
>   a string or NIL if there ain't no PUT parameter with this name."  
>   (hunchentoot:aux-request-value (make-symbol name)))
>
> but my function doesn't work ... 
> I think my mistake comes from i don't really understand how use the
> aux-request-value function.

Yes, it looks so.  AUX-REQUEST-VALUE is meant so you can /store/
arbitrary values associated with the request and later retrieve them.
I have no idea what REST-PUT-PARAMETER is supposed to do or what a
"PUT parameter" is.

> have u got any idea for this problem ? 

I don't understand the problem...

Did you look at CL-WEBDAV to see how it handles PUT requests as I told
you?

Cheers,
Edi.



More information about the Tbnl-devel mailing list