From minerva at agentsheets.com Thu Feb 9 20:41:17 2012 From: minerva at agentsheets.com (Michael Minerva) Date: Thu, 9 Feb 2012 13:41:17 -0700 Subject: [drakma-devel] A simple Cookie and viewing the actual Post Message-ID: <4EA9314D-09AD-4851-BBC9-0AD3032464DD@agentsheets.com> I just started using drakma today and so far it seems really great but I had a couple quesitons. First, is it possible to send a simpler for example i want my http-post to have something like this: Cookie: SESSdc0685ed01f285dab628a3700259e6bc=rCfmWLUeugRQNAQTs14yox_DWqZyGE2fYUS8W24j4co I tried making a drakma cookie and adding it to a cookie-jar but none of that seemed to work. Also, is there a way to print the actual post I am sending so I can see what might be wrong with it? Thanks a lot, --Mike From edi at agharta.de Thu Feb 9 21:09:20 2012 From: edi at agharta.de (Edi Weitz) Date: Thu, 9 Feb 2012 22:09:20 +0100 Subject: [drakma-devel] A simple Cookie and viewing the actual Post In-Reply-To: <4EA9314D-09AD-4851-BBC9-0AD3032464DD@agentsheets.com> References: <4EA9314D-09AD-4851-BBC9-0AD3032464DD@agentsheets.com> Message-ID: You know about this, don't you? http://weitz.de/drakma/#*header-stream* Otherwise, I don't really understand your question. Perhaps you could tell us what exactly you tried, what happened, and what you expected to happen. Cheers, Edi. On Thu, Feb 9, 2012 at 9:41 PM, Michael Minerva wrote: > I just started using drakma today and so far it seems really great but I had a couple quesitons. > > First, is it possible to send a simpler for example i want my http-post to have something like this: > > Cookie: SESSdc0685ed01f285dab628a3700259e6bc=rCfmWLUeugRQNAQTs14yox_DWqZyGE2fYUS8W24j4co > > I tried making a drakma cookie and adding it to a cookie-jar but none of that seemed to work. > > Also, is there a way to print the actual post I am sending so I can see what might be wrong with it? > > Thanks a lot, > > --Mike > > > _______________________________________________ > drakma-devel mailing list > drakma-devel at common-lisp.net > http://lists.common-lisp.net/cgi-bin/mailman/listinfo/drakma-devel From minerva at agentsheets.com Thu Feb 9 21:32:05 2012 From: minerva at agentsheets.com (Michael Minerva) Date: Thu, 9 Feb 2012 14:32:05 -0700 Subject: [drakma-devel] A simple Cookie and viewing the actual Post In-Reply-To: References: <4EA9314D-09AD-4851-BBC9-0AD3032464DD@agentsheets.com> Message-ID: I'm sorry if my question is unclear but I just started using Drakma today and I am not very experienced with http-requests in general. I am trying to create an http-request that looks something like this: POST /?q=node/create HTTP/1.1 Host: localhost:8888 Cookie: SESSdc0685ed01f285dab628a3700259e6bc=rCfmWLUeugRQNAQTs14yox_DWqZyGE2fYUS8W24j4co Content-Length: 0 Content-Type: application/x-www-form-urlencoded I tried doing this with a cookie-jar and a cookie but the make-instance of cookie required parameters such as name which I do not have (and did not need when I made the http-request by other means). I wanted to see the actual http-post that was being created so I could compare it to other successful http-posts and try and find my problem (is this what header-stream might help with)? --Mike On Feb 9, 2012, at 2:09 PM, Edi Weitz wrote: > You know about this, don't you? > > http://weitz.de/drakma/#*header-stream* > > Otherwise, I don't really understand your question. Perhaps you could > tell us what exactly you tried, what happened, and what you expected > to happen. > > Cheers, > Edi. > > > On Thu, Feb 9, 2012 at 9:41 PM, Michael Minerva wrote: >> I just started using drakma today and so far it seems really great but I had a couple quesitons. >> >> First, is it possible to send a simpler for example i want my http-post to have something like this: >> >> Cookie: SESSdc0685ed01f285dab628a3700259e6bc=rCfmWLUeugRQNAQTs14yox_DWqZyGE2fYUS8W24j4co >> >> I tried making a drakma cookie and adding it to a cookie-jar but none of that seemed to work. >> >> Also, is there a way to print the actual post I am sending so I can see what might be wrong with it? >> >> Thanks a lot, >> >> --Mike >> >> >> _______________________________________________ >> drakma-devel mailing list >> drakma-devel at common-lisp.net >> http://lists.common-lisp.net/cgi-bin/mailman/listinfo/drakma-devel > > _______________________________________________ > drakma-devel mailing list > drakma-devel at common-lisp.net > http://lists.common-lisp.net/cgi-bin/mailman/listinfo/drakma-devel > From ryan at acceleration.net Mon Feb 13 15:51:14 2012 From: ryan at acceleration.net (Ryan Davis) Date: Mon, 13 Feb 2012 10:51:14 -0500 Subject: [drakma-devel] A simple Cookie and viewing the actual Post In-Reply-To: References: <4EA9314D-09AD-4851-BBC9-0AD3032464DD@agentsheets.com> Message-ID: <4F393172.3040700@acceleration.net> It looks like you are wanting a session cookie (http://en.wikipedia.org/wiki/HTTP_cookie#Session_cookie). These are a bit of a special case usage of cookies; your server issues each HTTP client (usually a web browser) a unique ID that is used to track some state on the server. This is generally impossible to know in advance. If you trace the HTTP traffic in a browser, I bet you make two requests; one where the server issues the session cookie (frequently a login page), and then another that POSTs to node/create. In drakma you can do the same thing, make two requests, and use the same 'drakma:cookie-jar in both requests. Some psuedo-code: (let ((cookie-jar (make-instance 'drakma:cookie-jar))) (drakma:http-request "http://path/to/create/session" :method :post :cookie-jar cookie-jar) (drakma:http-request "http://path/to/create/node" :method :post :cookie-jar cookie-jar) ) The drakma:cookie-jar will accept the session cookie from the server in the first http-request, and then pass it back to the server in the second http-request. Of course, you'll need to fill out the http-request parameters to match what your server is asking for. HTH, Ryan Davis Acceleration.net Director of Programming Services 2831 NW 41st street, suite B Gainesville, FL 32606 Office: 352-335-6500 x 124 Fax: 352-335-6506 On 2/9/2012 4:32 PM, Michael Minerva wrote: > I'm sorry if my question is unclear but I just started using Drakma today and I am not very experienced with http-requests in general. > > I am trying to create an http-request that looks something like this: > > POST /?q=node/create HTTP/1.1 > Host: localhost:8888 > Cookie: SESSdc0685ed01f285dab628a3700259e6bc=rCfmWLUeugRQNAQTs14yox_DWqZyGE2fYUS8W24j4co > Content-Length: 0 > Content-Type: application/x-www-form-urlencoded > > I tried doing this with a cookie-jar and a cookie but the make-instance of cookie required parameters such as name which I do not have (and did not need when I made the http-request by other means). I wanted to see the actual http-post that was being created so I could compare it to other successful http-posts and try and find my problem (is this what header-stream might help with)? > > --Mike > On Feb 9, 2012, at 2:09 PM, Edi Weitz wrote: > >> You know about this, don't you? >> >> http://weitz.de/drakma/#*header-stream* >> >> Otherwise, I don't really understand your question. Perhaps you could >> tell us what exactly you tried, what happened, and what you expected >> to happen. >> >> Cheers, >> Edi. >> >> >> On Thu, Feb 9, 2012 at 9:41 PM, Michael Minerva wrote: >>> I just started using drakma today and so far it seems really great but I had a couple quesitons. >>> >>> First, is it possible to send a simpler for example i want my http-post to have something like this: >>> >>> Cookie: SESSdc0685ed01f285dab628a3700259e6bc=rCfmWLUeugRQNAQTs14yox_DWqZyGE2fYUS8W24j4co >>> >>> I tried making a drakma cookie and adding it to a cookie-jar but none of that seemed to work. >>> >>> Also, is there a way to print the actual post I am sending so I can see what might be wrong with it? >>> >>> Thanks a lot, >>> >>> --Mike >>> >>> >>> _______________________________________________ >>> drakma-devel mailing list >>> drakma-devel at common-lisp.net >>> http://lists.common-lisp.net/cgi-bin/mailman/listinfo/drakma-devel >> _______________________________________________ >> drakma-devel mailing list >> drakma-devel at common-lisp.net >> http://lists.common-lisp.net/cgi-bin/mailman/listinfo/drakma-devel >> > > _______________________________________________ > drakma-devel mailing list > drakma-devel at common-lisp.net > http://lists.common-lisp.net/cgi-bin/mailman/listinfo/drakma-devel From wnesensohn at gmail.com Mon Feb 27 19:20:29 2012 From: wnesensohn at gmail.com (Willi Nesensohn) Date: Mon, 27 Feb 2012 20:20:29 +0100 Subject: [drakma-devel] http redirect following url-encodes location Message-ID: <4F4BD77D.7090907@gmail.com> I'm using drakma to GET data over http. It turns out that when following redirects, drakma uses the location in the redirection header, which it url-encodes. Usually this might not be a problem, but when the location redirected to is already url-encoded this method fails. Is this intended behaviour? I'm not sure what the clean solution to this would be, as decoding the location before using it just doesn't feel right. For the lack of a better solution that's what i'm doing right now though. Any pointers in the right direction would be greatly appreciated. Best regards, Wilfried Nesensohn