From edi at agharta.de Thu Sep 6 23:18:34 2007 From: edi at agharta.de (Edi Weitz) Date: Fri, 07 Sep 2007 01:18:34 +0200 Subject: [drakma-devel] New Chunga release 0.3.1 Message-ID: ChangeLog: Version 0.3.1 2007-09-07 Fixed bug in STREAM-LISTEN Download: http://weitz.de/files/chunga.tar.gz From edi at agharta.de Tue Sep 18 07:12:34 2007 From: edi at agharta.de (Edi Weitz) Date: Tue, 18 Sep 2007 09:12:34 +0200 Subject: [drakma-devel] New Chunga release 0.4.0 Message-ID: ChangeLog: Version 0.4.0 2007-09-18 Added *TREAT-SEMICOLON-AS-CONTINUATION* [Note that Chunga's behaviour will be incompatible with previous versions in the rare case that you're reading headers which end with a semicolon. Use this variable to override.] Download: http://weitz.de/files/chunga.tar.gz From lam at tuxfamily.org Tue Sep 18 11:23:32 2007 From: lam at tuxfamily.org (Nicolas Lamirault) Date: Tue, 18 Sep 2007 13:23:32 +0200 Subject: [drakma-devel] Problem abouth POST HTTP request Message-ID: <876428p68b.fsf@no-log.org> hi, i've got this request : $> curl --data '{"author":"nicolas"}' http://localhost:8888/test -H "application/json" {"ok":true,"_id":"C97DCFBF09D32461D60F0D30BF3E807C","_rev":555997582}% i would like to make the same request using Drakma : CL-USER> (drakma:http-request "http://localhost:8888/test" :method :post :form-data t :external-format-out :UTF-8 :parameters '(("author" . "nicolas"))) POST /test HTTP/1.1 Host: localhost:8888 User-Agent: Drakma/0.9.1 (SBCL 1.0; Linux; 2.6.15-23-686; http://weitz.de/drakma/) Accept: */* Connection: close Content-Type: multipart/form-data; boundary=----------sUTYSe7i1UX7ONyEB68U4BbXyx2TZYZ0x1Qmx4vCVWyI9Bpb92 Content-Length: 188 HTTP/1.1 500 Internal Server Error Server: inets/develop Date: Tue, 18 Sep 2007 10:54:03 GMT Cache-Control: no-cache Pragma: no-cache Expires: Tue, 18 Sep 2007 10:54:03 GMT Damien: awesome Content-Type: text/plain; charset=utf-8 Transfer-Encoding: chunked Connection:close "{\"error\":{\"id\":\"EXIT\",\"reason\":\"{function_clause,[{cjson,tokenize_number,[[45,45,45,45,45,45,45,45,45,45,45,115,85,84,89,83,101,55,105,49,85,88,55,79,78,121,69,66,54,56,85,52,66,98,88,121,120,50,84,90,89,90,48,120,49,81,109,120,52,118,67,86,87,121,73,57,66,112,98,57,50,13,10,67,111,110,116,101,110,116,45,68,105,115,112,111,115,105,116,105,111,110,58,32,102,111,114,109,45,100,97,116,97,59,32,110,97,109,101,61,34,97,117,116,104,111,114,34,13,10,13,10,110,105,99,111,108,97,115,13,10,45,45,45,45,45,45,45,45,45,45,45,45,115,85,84,89,83,101,55,105,49,85,88,55,79,78,121,69,66,54,56,85,52,66,98,88,121,120,50,84,90,89,90,48,120,49,81,109,120,52,118,67,86,87,121,73,57,66,112,98,57,50,45,45,13,10],int,{decoder,utf8,null,1,2,any},[45]]},{cjson,tokenize,2},{cjson,decode1,2},{cjson,json_decode,2},{mod_couch,handle_db_request,3},{mod_couch,do,1},{httpd_response,traverse_modules,2},{httpd_response,generate_and_send_response,1}]}\"}}" 500 ((:SERVER . "inets/develop") (:DATE . "Tue, 18 Sep 2007 10:54:03 GMT") (:CACHE-CONTROL . "no-cache") (:PRAGMA . "no-cache") (:EXPIRES . "Tue, 18 Sep 2007 10:54:03 GMT") (:DAMIEN . "awesome") (:CONTENT-TYPE . "text/plain; charset=utf-8") (:TRANSFER-ENCODING . "chunked") (:CONNECTION . "close")) # # T "Internal Server Error" i've got an error code 500. Due to a bad request i think. Someon knows what error i did in this request ? thanks. -- Nicolas Lamirault From rm at seid-online.de Tue Sep 18 11:40:24 2007 From: rm at seid-online.de (Ralf Mattes) Date: Tue, 18 Sep 2007 13:40:24 +0200 Subject: [drakma-devel] Problem abouth POST HTTP request In-Reply-To: <876428p68b.fsf@no-log.org> References: <876428p68b.fsf@no-log.org> Message-ID: <1190115624.5763.7.camel@localhost.localdomain> Hi, just some quick shots into the dark ... On Tue, 2007-09-18 at 13:23 +0200, Nicolas Lamirault wrote: > hi, > i've got this request : > > $> curl --data '{"author":"nicolas"}' http://localhost:8888/test -H "application/json" > {"ok":true,"_id":"C97DCFBF09D32461D60F0D30BF3E807C","_rev":555997582}% Is this _really_ the command line you use? Shouldn't this read ... -H 'Content-Type: application/json" ... ? I guess you server implementation isn't too picky/stable/wel--programmed and blindly reads the request data anyway :-/ > i would like to make the same request using Drakma : > > CL-USER> (drakma:http-request "http://localhost:8888/test" > :method :post > :form-data t > :external-format-out :UTF-8 > :parameters '(("author" . "nicolas"))) But this will send the request data formated as multipart/form-data and of course the toy-parser will hickup un that. What do you expect? HTH RalfD (hoping Edi's server will accept my mail ...) > POST /test HTTP/1.1 > Host: localhost:8888 > User-Agent: Drakma/0.9.1 (SBCL 1.0; Linux; 2.6.15-23-686; http://weitz.de/drakma/) > Accept: */* > Connection: close > Content-Type: multipart/form-data; boundary=----------sUTYSe7i1UX7ONyEB68U4BbXyx2TZYZ0x1Qmx4vCVWyI9Bpb92 > Content-Length: 188 > > HTTP/1.1 500 Internal Server Error > Server: inets/develop > Date: Tue, 18 Sep 2007 10:54:03 GMT > Cache-Control: no-cache > Pragma: no-cache > Expires: Tue, 18 Sep 2007 10:54:03 GMT > Damien: awesome > Content-Type: text/plain; charset=utf-8 > Transfer-Encoding: chunked > Connection:close > > "{\"error\":{\"id\":\"EXIT\",\"reason\":\"{function_clause,[{cjson,tokenize_number,[[45,45,45,45,45,45,45,45,45,45,45,115,85,84,89,83,101,55,105,49,85,88,55,79,78,121,69,66,54,56,85,52,66,98,88,121,120,50,84,90,89,90,48,120,49,81,109,120,52,118,67,86,87,121,73,57,66,112,98,57,50,13,10,67,111,110,116,101,110,116,45,68,105,115,112,111,115,105,116,105,111,110,58,32,102,111,114,109,45,100,97,116,97,59,32,110,97,109,101,61,34,97,117,116,104,111,114,34,13,10,13,10,110,105,99,111,108,97,115,13,10,45,45,45,45,45,45,45,45,45,45,45,45,115,85,84,89,83,101,55,105,49,85,88,55,79,78,121,69,66,54,56,85,52,66,98,88,121,120,50,84,90,89,90,48,120,49,81,109,120,52,118,67,86,87,121,73,57,66,112,98,57,50,45,45,13,10],int,{decoder,utf8,null,1,2,any},[45]]},{cjson,tokenize,2},{cjson,decode1,2},{cjson,json_decode,2},{mod_couch,handle_db_request,3},{mod_couch,do,1},{httpd_response,traverse_modules,2},{httpd_response,generate_and_send_response,1}]}\"}}" > 500 > ((:SERVER . "inets/develop") (:DATE . "Tue, 18 Sep 2007 10:54:03 GMT") > (:CACHE-CONTROL . "no-cache") (:PRAGMA . "no-cache") > (:EXPIRES . "Tue, 18 Sep 2007 10:54:03 GMT") (:DAMIEN . "awesome") > (:CONTENT-TYPE . "text/plain; charset=utf-8") (:TRANSFER-ENCODING > . "chunked") > (:CONNECTION . "close")) > # > # > T > "Internal Server Error" > > > i've got an error code 500. Due to a bad request i think. Someon knows > what error i did in this request ? > > thanks. > > From lam at tuxfamily.org Tue Sep 18 11:55:39 2007 From: lam at tuxfamily.org (Nicolas Lamirault) Date: Tue, 18 Sep 2007 13:55:39 +0200 Subject: [drakma-devel] Problem abouth POST HTTP request In-Reply-To: <1190115624.5763.7.camel@localhost.localdomain> (Ralf Mattes's message of "Tue\, 18 Sep 2007 13\:40\:24 +0200") References: <876428p68b.fsf@no-log.org> <1190115624.5763.7.camel@localhost.localdomain> Message-ID: <871wcwp4qs.fsf@no-log.org> thanks for your response. Ralf Mattes writes: > Hi, just some quick shots into the dark ... > > On Tue, 2007-09-18 at 13:23 +0200, Nicolas Lamirault wrote: >> hi, >> i've got this request : >> >> $> curl --data '{"author":"nicolas"}' http://localhost:8888/test -H "application/json" >> {"ok":true,"_id":"C97DCFBF09D32461D60F0D30BF3E807C","_rev":555997582}% > > Is this _really_ the command line you use? Shouldn't this read > > ... -H 'Content-Type: application/json" ... ? i try this, and i've got the right result : * curl -v --data '{"author":"nicolas"}' http://localhost:8888/test * About to connect() to localhost port 8888 * Trying 127.0.0.1... connected * Connected to localhost (127.0.0.1) port 8888 > POST /test HTTP/1.1 > User-Agent: curl/7.15.5 (i486-pc-linux-gnu) libcurl/7.15.5 > OpenSSL/0.9.8c zlib/1.2.3 libidn/0.6.5 > Host: localhost:8888 > Accept: */* > Content-Length: 20 > Content-Type: application/x-www-form-urlencoded > > {"author":"nicolas"}HTTP/1.1 201 Created < Server: inets/develop < Date: Tue, 18 Sep 2007 11:53:10 GMT < Cache-Control: no-cache < Pragma: no-cache < Expires: Tue, 18 Sep 2007 11:53:10 GMT < Damien: awesome < Content-Type: text/plain; charset=utf-8 < Transfer-Encoding: chunked < X-Couch-Id: 2FC290BA0DB5B1DDB1BE10EBB671C3A0 < X-Couch-Rev: -1041032725 * Connection #0 to host localhost left intact * Closing connection #0 {"ok":true,"_id":"2FC290BA0DB5B1DDB1BE10EBB671C3A0","_rev":-1041032725}% > I guess you server implementation isn't too picky/stable/wel--programmed > and blindly reads the request data anyway :-/ > >> i would like to make the same request using Drakma : >> >> CL-USER> (drakma:http-request "http://localhost:8888/test" >> :method :post >> :form-data t >> :external-format-out :UTF-8 >> :parameters '(("author" . "nicolas"))) > > But this will send the request data formated as multipart/form-data and > of course the toy-parser will hickup un that. What do you expect? i would like a http code 200 and a result like this : {"ok":true, "_id":".....", "_rev":xxxxx} > HTH RalfD > > (hoping Edi's server will accept my mail ...) > >> POST /test HTTP/1.1 >> Host: localhost:8888 >> User-Agent: Drakma/0.9.1 (SBCL 1.0; Linux; 2.6.15-23-686; http://weitz.de/drakma/) >> Accept: */* >> Connection: close >> Content-Type: multipart/form-data; boundary=----------sUTYSe7i1UX7ONyEB68U4BbXyx2TZYZ0x1Qmx4vCVWyI9Bpb92 >> Content-Length: 188 >> >> HTTP/1.1 500 Internal Server Error >> Server: inets/develop >> Date: Tue, 18 Sep 2007 10:54:03 GMT >> Cache-Control: no-cache >> Pragma: no-cache >> Expires: Tue, 18 Sep 2007 10:54:03 GMT >> Damien: awesome >> Content-Type: text/plain; charset=utf-8 >> Transfer-Encoding: chunked >> Connection:close >> >> "{\"error\":{\"id\":\"EXIT\",\"reason\":\"{function_clause,[{cjson,tokenize_number,[[45,45,45,45,45,45,45,45,45,45,45,115,85,84,89,83,101,55,105,49,85,88,55,79,78,121,69,66,54,56,85,52,66,98,88,121,120,50,84,90,89,90,48,120,49,81,109,120,52,118,67,86,87,121,73,57,66,112,98,57,50,13,10,67,111,110,116,101,110,116,45,68,105,115,112,111,115,105,116,105,111,110,58,32,102,111,114,109,45,100,97,116,97,59,32,110,97,109,101,61,34,97,117,116,104,111,114,34,13,10,13,10,110,105,99,111,108,97,115,13,10,45,45,45,45,45,45,45,45,45,45,45,45,115,85,84,89,83,101,55,105,49,85,88,55,79,78,121,69,66,54,56,85,52,66,98,88,121,120,50,84,90,89,90,48,120,49,81,109,120,52,118,67,86,87,121,73,57,66,112,98,57,50,45,45,13,10],int,{decoder,utf8,null,1,2,any},[45]]},{cjson,tokenize,2},{cjson,decode1,2},{cjson,json_decode,2},{mod_couch,handle_db_request,3},{mod_couch,do,1},{httpd_response,traverse_modules,2},{httpd_response,generate_and_send_response,1}]}\"}}" >> 500 >> ((:SERVER . "inets/develop") (:DATE . "Tue, 18 Sep 2007 10:54:03 GMT") >> (:CACHE-CONTROL . "no-cache") (:PRAGMA . "no-cache") >> (:EXPIRES . "Tue, 18 Sep 2007 10:54:03 GMT") (:DAMIEN . "awesome") >> (:CONTENT-TYPE . "text/plain; charset=utf-8") (:TRANSFER-ENCODING >> . "chunked") >> (:CONNECTION . "close")) >> # >> # >> T >> "Internal Server Error" >> >> >> i've got an error code 500. Due to a bad request i think. Someon knows >> what error i did in this request ? >> >> thanks. >> >> > > _______________________________________________ > drakma-devel mailing list > drakma-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/drakma-devel > -- Nicolas Lamirault From rm at seid-online.de Tue Sep 18 12:09:46 2007 From: rm at seid-online.de (Ralf Mattes) Date: Tue, 18 Sep 2007 14:09:46 +0200 Subject: [drakma-devel] Problem abouth POST HTTP request In-Reply-To: <871wcwp4qs.fsf@no-log.org> References: <876428p68b.fsf@no-log.org> <1190115624.5763.7.camel@localhost.localdomain> <871wcwp4qs.fsf@no-log.org> Message-ID: <1190117386.5763.14.camel@localhost.localdomain> On Tue, 2007-09-18 at 13:55 +0200, Nicolas Lamirault wrote: > thanks for your response. > > > I guess you server implementation isn't too picky/stable/wel--programmed > > and blindly reads the request data anyway :-/ > > > >> i would like to make the same request using Drakma : > >> > >> CL-USER> (drakma:http-request "http://localhost:8888/test" > >> :method :post > >> :form-data t > >> :external-format-out :UTF-8 > >> :parameters '(("author" . "nicolas"))) > > > > But this will send the request data formated as multipart/form-data and > > of course the toy-parser will hickup un that. What do you expect? > > i would like a http code 200 and a result like this : ;-) Programming by wish - I wish that would work. Your server seems to expect the request data in json format. That means you can't use drakma's :parameters keyword. You want to use :content (http://weitz.de/drakma/#content) and provide the content in json format (you could use http://common-lisp.net/project/cl-json/ if you are too lazzy to reinvent the wheel). HTH RalfD From lam at tuxfamily.org Tue Sep 18 12:42:36 2007 From: lam at tuxfamily.org (Nicolas Lamirault) Date: Tue, 18 Sep 2007 14:42:36 +0200 Subject: [drakma-devel] Problem abouth POST HTTP request In-Reply-To: <1190117386.5763.14.camel@localhost.localdomain> (Ralf Mattes's message of "Tue\, 18 Sep 2007 14\:09\:46 +0200") References: <876428p68b.fsf@no-log.org> <1190115624.5763.7.camel@localhost.localdomain> <871wcwp4qs.fsf@no-log.org> <1190117386.5763.14.camel@localhost.localdomain> Message-ID: <87wsuono03.fsf@no-log.org> ok thanks. i will try with :content parameter. it's not my server :) thanks for your help Ralf Mattes writes: > On Tue, 2007-09-18 at 13:55 +0200, Nicolas Lamirault wrote: >> thanks for your response. > >> >> > I guess you server implementation isn't too picky/stable/wel--programmed >> > and blindly reads the request data anyway :-/ >> > >> >> i would like to make the same request using Drakma : >> >> >> >> CL-USER> (drakma:http-request "http://localhost:8888/test" >> >> :method :post >> >> :form-data t >> >> :external-format-out :UTF-8 >> >> :parameters '(("author" . "nicolas"))) >> > >> > But this will send the request data formated as multipart/form-data and >> > of course the toy-parser will hickup un that. What do you expect? >> >> i would like a http code 200 and a result like this : > > ;-) Programming by wish - I wish that would work. > Your server seems to expect the request data in json format. That means > you can't use drakma's :parameters keyword. You want to use :content > (http://weitz.de/drakma/#content) and provide the content in json format > (you could use http://common-lisp.net/project/cl-json/ if you are too > lazzy to reinvent the wheel). > > HTH RalfD > > -- Nicolas Lamirault From edi at agharta.de Tue Sep 18 14:32:07 2007 From: edi at agharta.de (Edi Weitz) Date: Tue, 18 Sep 2007 16:32:07 +0200 Subject: [drakma-devel] New release 0.10.0 (Was: Drakma and metaweb) In-Reply-To: (Alexey Goldin's message of "Mon, 17 Sep 2007 22:29:13 -0500") References: Message-ID: On Mon, 17 Sep 2007 22:29:13 -0500, "Alexey Goldin" wrote: > Sorry, could not find specific Drakma list so I send it to you > directly. Really? What did you try? I'd say the mailing list is hard to miss. > Below is the code I use (I use Lisp very episodically, so pardon my > style). I have problems with freebase-login function. Here is what > Metaweb sends me (etherial capture, cookies typed over with **** > just in case) Please try again with the latest versions of Chunga (0.4.0) and Drakma (0.10.0) and see if that fixes it. And please report back to the mailing list. Thanks, Edi. From alexey.goldin at gmail.com Thu Sep 20 02:18:37 2007 From: alexey.goldin at gmail.com (Alexey Goldin) Date: Wed, 19 Sep 2007 21:18:37 -0500 Subject: [drakma-devel] Re: New release 0.10.0 (Was: Drakma and metaweb) In-Reply-To: References: Message-ID: New version works without any changes! Thanks! The only problem is that I have not figured out yet how to get response as string, not as octets (the sever sets "Media Type" to application/json) On 9/18/07, Edi Weitz wrote: > On Mon, 17 Sep 2007 22:29:13 -0500, "Alexey Goldin" wrote: > > > Sorry, could not find specific Drakma list so I send it to you > > directly. > > Really? What did you try? I'd say the mailing list is hard to miss. > From alexey.goldin at gmail.com Thu Sep 20 03:23:47 2007 From: alexey.goldin at gmail.com (Alexey Goldin) Date: Wed, 19 Sep 2007 22:23:47 -0500 Subject: [drakma-devel] Re: New release 0.10.0 (Was: Drakma and metaweb) In-Reply-To: References: Message-ID: Actually, :want-stream gives me stream that I can read from with no problem. Thanks, I have everything I might need. Edi, if you ever show up in Chicago, I owe you beverage of your choice. On 9/19/07, Alexey Goldin wrote: > New version works without any changes! Thanks! The only problem is > that I have not figured out yet how to get response as string, not as > octets (the sever sets "Media Type" to application/json) > > > From jan at rychter.com Tue Sep 25 11:12:12 2007 From: jan at rychter.com (Jan Rychter) Date: Tue, 25 Sep 2007 13:12:12 +0200 Subject: [drakma-devel] parameters in post requests Message-ID: 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 From edi at agharta.de Tue Sep 25 15:02:15 2007 From: edi at agharta.de (Edi Weitz) Date: Tue, 25 Sep 2007 17:02:15 +0200 Subject: [drakma-devel] parameters in post requests In-Reply-To: (Jan Rychter's message of "Tue, 25 Sep 2007 13:12:12 +0200") References: Message-ID: On Tue, 25 Sep 2007 13:12:12 +0200, Jan Rychter 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. From edi at agharta.de Tue Sep 25 15:12:24 2007 From: edi at agharta.de (Edi Weitz) Date: Tue, 25 Sep 2007 17:12:24 +0200 Subject: [drakma-devel] New release 0.10.1 (Was: parameters in post requests) In-Reply-To: (Edi Weitz's message of "Tue, 25 Sep 2007 17:02:15 +0200") References: Message-ID: On Tue, 25 Sep 2007 17:02:15 +0200, Edi Weitz 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. From jan at rychter.com Wed Sep 26 10:50:29 2007 From: jan at rychter.com (Jan Rychter) Date: Wed, 26 Sep 2007 12:50:29 +0200 Subject: [drakma-devel] New release 0.10.1 (Was: parameters in post requests) In-Reply-To: (Edi Weitz's message of "Tue, 25 Sep 2007 17:12:24 +0200") References: Message-ID: Edi Weitz writes: > On Tue, 25 Sep 2007 17:02:15 +0200, Edi Weitz 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. From ross at sourcelabs.com Sat Sep 29 07:00:12 2007 From: ross at sourcelabs.com (Ross Jekel) Date: Sat, 29 Sep 2007 00:00:12 -0700 (PDT) Subject: [drakma-devel] http-request header issue Message-ID: <16474436.44911191049212441.JavaMail.root@mail-101.colo.sourcelabs.com> Hi, I'm a first time user of Drakma and I so much appreciate this library. I've been using Aserve's client functions which so far have been nothing but frustrating. Unforunately, the first time I tried Drakma it fail for me. What I was trying to do was get the wsdl file from my localhost. The URL was something like http://localhost:1579/wsdl. The wsdl service on this box requires basic authentication for everything except getting the wsdl (go figure). The problem was that when Drakma sent the header it had a '?' in the GET request. GET /wsdl? HTTP/1.1 Just the presence of the '?' for this server caused it to send back: HTTP/1.0 401 Unauthorized Well, I looked at the code in request.lisp and around line 450 and it sure looks like it should leave off the '?': (format nil "~A~@[?~A~]" (or (uri-path uri) "/") (uri-query uri) Trouble is, a few lines above it setf's (uri-query uri) to an empty string "" if parameters-used-p is t but parameters is nil. (unless parameters-used-p (setf (uri-query uri) ;; append parameters to existing query of URI (format nil "~@[~A~]~:*~:[~;&~]~A" (uri-query uri) (alist-to-url-encoded-string parameters external-format-out)))) I was able to change the unless line to: (unless (or parameters-used-p (not parameters)) and now the GET header is: GET /wsdl HTTP/1.1 I didn't think this was a big enough change for a patch, but thought it might be useful. The way I wrote it might be hard to read (unless with a not...), but I was just trying it to see if it worked. (when (and (not parameters-used-p) parameters) Might read better. Thanks, Ross From ross at sourcelabs.com Sat Sep 29 07:04:59 2007 From: ross at sourcelabs.com (Ross Jekel) Date: Sat, 29 Sep 2007 00:04:59 -0700 (PDT) Subject: [drakma-devel] utf-8 question Message-ID: <1919890510.44941191049499223.JavaMail.root@mail-101.colo.sourcelabs.com> Hi, I'm using Drakma 0.10.1 with AllegroCL 8.1. When I make an http-request to get a wsdl file which returns the response header: Content-Type: text/xml; charset=utf-8 the contents returned are a vector of octets. I got the impression from the examples that it would autosense the content type and return a decoded-string. Am I doing something wrong? Thanks, Ross From edi at agharta.de Sat Sep 29 14:06:04 2007 From: edi at agharta.de (Edi Weitz) Date: Sat, 29 Sep 2007 16:06:04 +0200 Subject: [drakma-devel] New release 0.10.2 (Was: http-request header issue) In-Reply-To: <16474436.44911191049212441.JavaMail.root@mail-101.colo.sourcelabs.com> (Ross Jekel's message of "Sat, 29 Sep 2007 00:00:12 -0700 (PDT)") References: <16474436.44911191049212441.JavaMail.root@mail-101.colo.sourcelabs.com> Message-ID: On Sat, 29 Sep 2007 00:00:12 -0700 (PDT), Ross Jekel wrote: > Trouble is, a few lines above it setf's (uri-query uri) to an empty > string "" if parameters-used-p is t but parameters is nil. Ah, yes, thanks. That was a bug I introduced with my 0.10.1 change. Should be fixed now. Edi. From edi at agharta.de Sat Sep 29 14:10:17 2007 From: edi at agharta.de (Edi Weitz) Date: Sat, 29 Sep 2007 16:10:17 +0200 Subject: [drakma-devel] utf-8 question In-Reply-To: <1919890510.44941191049499223.JavaMail.root@mail-101.colo.sourcelabs.com> (Ross Jekel's message of "Sat, 29 Sep 2007 00:04:59 -0700 (PDT)") References: <1919890510.44941191049499223.JavaMail.root@mail-101.colo.sourcelabs.com> Message-ID: On Sat, 29 Sep 2007 00:04:59 -0700 (PDT), Ross Jekel wrote: > I'm using Drakma 0.10.1 with AllegroCL 8.1. When I make an > http-request to get a wsdl file which returns the response header: > > Content-Type: text/xml; charset=utf-8 > > the contents returned are a vector of octets. I got the impression > from the examples that it would autosense the content type and > return a decoded-string. Am I doing something wrong? No, it should behave as you expect. This what I get (LWW 5.0.2): CL-USER 1 > (setq drakma:*header-stream* *standard-output*) # 2190100B> CL-USER 2 > (drakma:http-request "http://zappa.agharta.de/test.xml") GET /test.xml HTTP/1.1 Host: zappa.agharta.de User-Agent: Drakma/0.10.1 (LispWorks 5.0.2; Windows NT; Windows XP: 5.1 (build 2600) Service Pack 2; http://weitz.de/drakma/) Accept: */* Connection: close HTTP/1.1 200 OK Date: Sat, 29 Sep 2007 14:00:47 GMT Server: Apache Connection: close Transfer-Encoding: chunked Content-Type: text/xml; charset=utf-8 " ???. " 200 ((:DATE . "Sat, 29 Sep 2007 14:00:47 GMT") (:SERVER . "Apache") (:CONNECTION . "close") (:TRANSFER-ENCODING . "chunked") (:CONTENT-TYPE . "text/xml; charset=utf-8")) # # T "OK" Do you get the same result with the URL above? (I'll leave it online for testing purposes.) And can you send the headers sent back and forth between Drakma and the server to the mailing list? How does your HTTP-REQUEST call look like? Edi. From ross at sourcelabs.com Sat Sep 29 16:21:50 2007 From: ross at sourcelabs.com (Ross Jekel) Date: Sat, 29 Sep 2007 09:21:50 -0700 (PDT) Subject: [drakma-devel] utf-8 question In-Reply-To: <432996582.45211191082832983.JavaMail.root@mail-101.colo.sourcelabs.com> Message-ID: <813400564.45231191082910224.JavaMail.root@mail-101.colo.sourcelabs.com> >Do you get the same result with the URL above? (I'll leave it online >for testing purposes.) And can you send the headers sent back and >forth between Drakma and the server to the mailing list? How does >your HTTP-REQUEST call look like? Thanks for your help, Eli. Here's what I get. I'll try to debug this as well a bit later today. cg-user(10): (setf drakma:*header-stream* *standard-output*) # cg-user(11): (drakma:http-request "http://zappa.agharta.de/test.xml") GET /test.xml HTTP/1.1 Host: zappa.agharta.de User-Agent: Drakma/0.10.1 (International Allegro CL Enterprise Edition 8.1 [Linux (x86)] (Sep 24, 2007 12:17); Linux (x86), glibc 2.3; Linux Xubuntu 2.6.17-12-generic #2 SMP Wed Aug 29 20:08:20 UTC 2007 i686 GNU/Linux; http://weitz.de/drakma/) Accept: */* Connection: close HTTP/1.1 200 OK Date: Sat, 29 Sep 2007 16:17:58 GMT Server: Apache Connection: close Transfer-Encoding: chunked Content-Type: text/xml; charset=utf-8 #(50 101 32 13 10 60 104 116 109 108 ...) 200 ((:DATE . "Sat, 29 Sep 2007 16:17:58 GMT") (:SERVER . "Apache") (:CONNECTION . "close") (:TRANSFER-ENCODING . "chunked") (:CONTENT-TYPE . "text/xml; charset=utf-8")) # # t "OK" cg-user(12): From edi at agharta.de Sat Sep 29 19:55:33 2007 From: edi at agharta.de (Edi Weitz) Date: Sat, 29 Sep 2007 21:55:33 +0200 Subject: [drakma-devel] utf-8 question In-Reply-To: <813400564.45231191082910224.JavaMail.root@mail-101.colo.sourcelabs.com> (Ross Jekel's message of "Sat, 29 Sep 2007 09:21:50 -0700 (PDT)") References: <813400564.45231191082910224.JavaMail.root@mail-101.colo.sourcelabs.com> Message-ID: On Sat, 29 Sep 2007 09:21:50 -0700 (PDT), Ross Jekel wrote: > Thanks for your help, Eli. Edi... > Here's what I get. I'll try to debug this as well a bit later today. I also just tried with Allegro CL 8.1 (but I only have it on Windows). Works fine for me. Could you check if you're using the newest versions of all the dependencies, specifically of Chunga and FLEXI-STREAMS? From ross at sourcelabs.com Sat Sep 29 23:52:28 2007 From: ross at sourcelabs.com (Ross Jekel) Date: Sat, 29 Sep 2007 16:52:28 -0700 (PDT) Subject: [drakma-devel] utf-8 question In-Reply-To: <610164247.45501191109767730.JavaMail.root@mail-101.colo.sourcelabs.com> Message-ID: <1206007250.45521191109948975.JavaMail.root@mail-101.colo.sourcelabs.com> Sorry for typing your name wrong... and thanks for trying this. I'll debug it on Linux here when I get a chance. Was gone most of the day. Here's my asdf directory which I think has the latest of everything. drwxr-xr-x 5 ross ross 4096 2007-08-14 07:33 asdf-install lrwxrwxrwx 1 ross ross 42 2007-09-28 22:13 asdf-install.asd -> asdf-install/asdf-install/asdf-install.asd drwxr-xr-x 3 ross ross 4096 2007-09-28 21:44 chunga-0.4.0 lrwxrwxrwx 1 ross ross 23 2007-09-28 22:14 chunga.asd -> chunga-0.4.0/chunga.asd drwxr-xr-x 2 ross ross 4096 2007-09-28 21:41 cl-base64-3.3.2 lrwxrwxrwx 1 ross ross 29 2007-09-28 22:14 cl-base64.asd -> cl-base64-3.3.2/cl-base64.asd drwxr-xr-x 3 ross ross 4096 2007-09-14 12:15 cl-log lrwxrwxrwx 1 ross ross 18 2007-09-28 22:14 cl-log.asd -> cl-log/cl-log.asdf drwxr-xr-x 3 ross ross 4096 2007-09-24 13:36 cl-utilities-1.2.4 lrwxrwxrwx 1 ross ross 35 2007-09-28 22:14 cl-utilities.asd -> cl-utilities-1.2.4/cl-utilities.asd drwxr-xr-x 3 ross ross 4096 2007-09-29 00:01 drakma-0.10.1 lrwxrwxrwx 1 ross ross 24 2007-09-28 22:14 drakma.asd -> drakma-0.10.1/drakma.asd drwxr-xr-x 4 ross ross 4096 2007-09-29 16:50 flexi-streams-0.13.0 lrwxrwxrwx 1 ross ross 38 2007-09-28 22:15 flexi-streams.asd -> flexi-streams-0.13.0/flexi-streams.asd drwxr-xr-x 2 ross ross 4096 2007-09-28 21:44 puri-1.5.1 lrwxrwxrwx 1 ross ross 19 2007-09-28 22:15 puri.asd -> puri-1.5.1/puri.asd drwxr-xr-x 3 ross ross 4096 2007-09-28 21:49 trivial-gray-streams-2006-09-16 lrwxrwxrwx 1 ross ross 56 2007-09-28 22:15 trivial-gray-streams.asd -> trivial-gray-streams-2006-09-16/trivial-gray-streams.asd drwxr-xr-x 6 ross ross 4096 2007-09-28 21:42 usocket-0.3.5 lrwxrwxrwx 1 ross ross 25 2007-09-28 22:16 usocket.asd -> usocket-0.3.5/usocket.asd drwxr-xr-x 2 ross ross 4096 2007-09-14 12:21 xml-emitter-1.0.2 lrwxrwxrwx 1 ross ross 33 2007-09-28 22:16 xml-emitter.asd -> xml-emitter-1.0.2/xml-emitter.asd Thanks, Ross ----- Original Message ----- From: "Edi Weitz" To: "General interest list for Drakma and Chunga" Sent: Saturday, September 29, 2007 12:55:33 PM (GMT-0800) America/Los_Angeles Subject: Re: [drakma-devel] utf-8 question On Sat, 29 Sep 2007 09:21:50 -0700 (PDT), Ross Jekel wrote: > Thanks for your help, Eli. Edi... > Here's what I get. I'll try to debug this as well a bit later today. I also just tried with Allegro CL 8.1 (but I only have it on Windows). Works fine for me. Could you check if you're using the newest versions of all the dependencies, specifically of Chunga and FLEXI-STREAMS? _______________________________________________ drakma-devel mailing list drakma-devel at common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/drakma-devel From ross at sourcelabs.com Sun Sep 30 17:40:24 2007 From: ross at sourcelabs.com (Ross Jekel) Date: Sun, 30 Sep 2007 10:40:24 -0700 (PDT) Subject: [drakma-devel] utf-8 question In-Reply-To: <1206007250.45521191109948975.JavaMail.root@mail-101.colo.sourcelabs.com> Message-ID: <1505449530.45781191174024216.JavaMail.root@mail-101.colo.sourcelabs.com> Okay, I tracked down my problem. I'm using Allegro CL in case-sensitive modern mode (the default). There are several places in chunga and drakma that might do something like (intern (string-upper somevalue) :keyword) making uppercase symbols such as :CONTENT-TYPE for headers or :UTF-8 for encoding types. If there is any code that compares against the lower-case symbol (such as :content-type in get-content-type in drakma/read.lisp), the match fails. I guess I haven't had a need for case-sensitivity, so it is probably more trouble than it is worth to have it on. Ross ----- Original Message ----- From: "Ross Jekel" To: "General interest list for Drakma and Chunga" Sent: Saturday, September 29, 2007 4:52:28 PM (GMT-0800) America/Los_Angeles Subject: Re: [drakma-devel] utf-8 question Sorry for typing your name wrong... and thanks for trying this. I'll debug it on Linux here when I get a chance. Was gone most of the day. Here's my asdf directory which I think has the latest of everything. drwxr-xr-x 5 ross ross 4096 2007-08-14 07:33 asdf-install lrwxrwxrwx 1 ross ross 42 2007-09-28 22:13 asdf-install.asd -> asdf-install/asdf-install/asdf-install.asd drwxr-xr-x 3 ross ross 4096 2007-09-28 21:44 chunga-0.4.0 lrwxrwxrwx 1 ross ross 23 2007-09-28 22:14 chunga.asd -> chunga-0.4.0/chunga.asd drwxr-xr-x 2 ross ross 4096 2007-09-28 21:41 cl-base64-3.3.2 lrwxrwxrwx 1 ross ross 29 2007-09-28 22:14 cl-base64.asd -> cl-base64-3.3.2/cl-base64.asd drwxr-xr-x 3 ross ross 4096 2007-09-14 12:15 cl-log lrwxrwxrwx 1 ross ross 18 2007-09-28 22:14 cl-log.asd -> cl-log/cl-log.asdf drwxr-xr-x 3 ross ross 4096 2007-09-24 13:36 cl-utilities-1.2.4 lrwxrwxrwx 1 ross ross 35 2007-09-28 22:14 cl-utilities.asd -> cl-utilities-1.2.4/cl-utilities.asd drwxr-xr-x 3 ross ross 4096 2007-09-29 00:01 drakma-0.10.1 lrwxrwxrwx 1 ross ross 24 2007-09-28 22:14 drakma.asd -> drakma-0.10.1/drakma.asd drwxr-xr-x 4 ross ross 4096 2007-09-29 16:50 flexi-streams-0.13.0 lrwxrwxrwx 1 ross ross 38 2007-09-28 22:15 flexi-streams.asd -> flexi-streams-0.13.0/flexi-streams.asd drwxr-xr-x 2 ross ross 4096 2007-09-28 21:44 puri-1.5.1 lrwxrwxrwx 1 ross ross 19 2007-09-28 22:15 puri.asd -> puri-1.5.1/puri.asd drwxr-xr-x 3 ross ross 4096 2007-09-28 21:49 trivial-gray-streams-2006-09-16 lrwxrwxrwx 1 ross ross 56 2007-09-28 22:15 trivial-gray-streams.asd -> trivial-gray-streams-2006-09-16/trivial-gray-streams.asd drwxr-xr-x 6 ross ross 4096 2007-09-28 21:42 usocket-0.3.5 lrwxrwxrwx 1 ross ross 25 2007-09-28 22:16 usocket.asd -> usocket-0.3.5/usocket.asd drwxr-xr-x 2 ross ross 4096 2007-09-14 12:21 xml-emitter-1.0.2 lrwxrwxrwx 1 ross ross 33 2007-09-28 22:16 xml-emitter.asd -> xml-emitter-1.0.2/xml-emitter.asd Thanks, Ross ----- Original Message ----- From: "Edi Weitz" To: "General interest list for Drakma and Chunga" Sent: Saturday, September 29, 2007 12:55:33 PM (GMT-0800) America/Los_Angeles Subject: Re: [drakma-devel] utf-8 question On Sat, 29 Sep 2007 09:21:50 -0700 (PDT), Ross Jekel wrote: > Thanks for your help, Eli. Edi... > Here's what I get. I'll try to debug this as well a bit later today. I also just tried with Allegro CL 8.1 (but I only have it on Windows). Works fine for me. Could you check if you're using the newest versions of all the dependencies, specifically of Chunga and FLEXI-STREAMS? _______________________________________________ drakma-devel mailing list drakma-devel at common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/drakma-devel _______________________________________________ drakma-devel mailing list drakma-devel at common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/drakma-devel From edi at agharta.de Sun Sep 30 18:37:46 2007 From: edi at agharta.de (Edi Weitz) Date: Sun, 30 Sep 2007 20:37:46 +0200 Subject: [drakma-devel] utf-8 question In-Reply-To: <1505449530.45781191174024216.JavaMail.root@mail-101.colo.sourcelabs.com> (Ross Jekel's message of "Sun, 30 Sep 2007 10:40:24 -0700 (PDT)") References: <1505449530.45781191174024216.JavaMail.root@mail-101.colo.sourcelabs.com> Message-ID: On Sun, 30 Sep 2007 10:40:24 -0700 (PDT), Ross Jekel wrote: > I'm using Allegro CL in case-sensitive modern mode (the > default). There are several places in chunga and drakma that might > do something like (intern (string-upper somevalue) :keyword) making > uppercase symbols such as :CONTENT-TYPE for headers or :UTF-8 for > encoding types. If there is any code that compares against the > lower-case symbol (such as :content-type in get-content-type in > drakma/read.lisp), the match fails. Ah, good, thanks for the analysis. I myself have never used "modern mode" and I don't really care about it, so I won't "fix" this myself, but if someone is interested in doing it, I'll gladly accept clean patches, of course. http://weitz.de/patches.html Thanks again, Edi.