[drakma-devel] parameters in post requests

I'm about to release CL-SQS, an interface to the Amazon Web Services SQS service. It uses Drakma for HTTP requests. However, I have encountered one issue: Amazon SQS requires POST requests with URL parameters, and Drakma by default does not want to include any parameters with POST requests. Would it be possible to include this small modification in Drakma? diff -c /Users/jwr/lisp/site/drakma-0.10.0/request.lisp.original /Users/jwr/lisp/site/drakma-0.10.0/request.lisp --- /Users/jwr/lisp/site/drakma-0.10.0/request.lisp.original Tue Sep 25 13:02:42 2007 +++ /Users/jwr/lisp/site/drakma-0.10.0/request.lisp Tue Sep 25 13:03:19 2007 @@ -428,7 +428,7 @@ (format http-stream "~?~C~C" fmt args #\Return #\Linefeed)) (write-header (name value-fmt &rest value-args) (write-http-line "~A: ~?" name value-fmt value-args))) - (when (and parameters (not (eq method :post))) + (when parameters (setf (uri-query uri) ;; append parameters to existing query of URI (format nil "~@[~A~]~:*~:[~;&~]~A" thanks, --Jan

On Tue, 25 Sep 2007 13:12:12 +0200, Jan Rychter <jan@rychter.com> wrote:
I'm about to release CL-SQS, an interface to the Amazon Web Services SQS service. It uses Drakma for HTTP requests. However, I have encountered one issue: Amazon SQS requires POST requests with URL parameters, and Drakma by default does not want to include any parameters with POST requests.
Yes, because usually the parameters of a POST request are in the body.
- (when (and parameters (not (eq method :post))) + (when parameters
That might be the right thing for your library, but it's certainly wrong for Drakma in general as it would always send the parameters twice. I'll see if I can come up with something better.

Edi Weitz <edi@agharta.de> writes:
On Tue, 25 Sep 2007 17:02:15 +0200, Edi Weitz <edi@agharta.de> wrote:
I'll see if I can come up with something better.
Please try the new release and let me know if it doesn't do what you want.
And if it does do what I want? It works just fine. Thanks! --J.
participants (2)
-
Edi Weitz
-
Jan Rychter