Hi,
I'm trying to write some tests for an HTTP based API. I need to check whether a server responds with a 302 status code and then need to check the referred location as well, without actually visiting that link.
How is it possible with drakma? If I use :redirect 0 then the http-request function throws up an error.
TIA Nandz.
Hi,
On Fri, 9 Feb 2007 17:31:18 +0530, "Saurabh Nanda" saurabhnanda@gmail.com wrote:
I'm trying to write some tests for an HTTP based API. I need to check whether a server responds with a 302 status code and then need to check the referred location as well, without actually visiting that link.
How is it possible with drakma? If I use :redirect 0 then the http-request function throws up an error.
How about setting :REDIRECT to NIL? See also :REDIRECT-METHODS.
Cheers, Edi.
Super! It works -- I should probably read the documentation more carefully the next time around!
Nandz.
On 2/9/07, Edi Weitz edi@agharta.de wrote:
Hi,
On Fri, 9 Feb 2007 17:31:18 +0530, "Saurabh Nanda" saurabhnanda@gmail.com wrote:
I'm trying to write some tests for an HTTP based API. I need to check whether a server responds with a 302 status code and then need to check the referred location as well, without actually visiting that link.
How is it possible with drakma? If I use :redirect 0 then the http-request function throws up an error.
How about setting :REDIRECT to NIL? See also :REDIRECT-METHODS.
Cheers, Edi. _______________________________________________ drakma-devel mailing list drakma-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/drakma-devel
If ":redirect nil" is set and the server responds with a Set-Cooke: header and an HTTP redirect, will the cookie be set?
I noticed that when the header is the following the cookie is set -- "Set-Cookie: cookie-name=some-randome-value"
But when the header is the following, the cookie is not set -- "Set-Cookie: cookie-name="
Is this correct, or is it some bug in my tests?
Regards, Saurabh.
On 2/9/07, Saurabh Nanda saurabhnanda@gmail.com wrote:
Super! It works -- I should probably read the documentation more carefully the next time around!
Nandz.
On 2/9/07, Edi Weitz edi@agharta.de wrote:
Hi,
On Fri, 9 Feb 2007 17:31:18 +0530, "Saurabh Nanda"
wrote:
I'm trying to write some tests for an HTTP based API. I need to check whether a server responds with a 302 status code and then need to check the referred location as well, without actually visiting that link.
How is it possible with drakma? If I use :redirect 0 then the http-request function throws up an error.
How about setting :REDIRECT to NIL? See also :REDIRECT-METHODS.
Cheers, Edi. _______________________________________________ drakma-devel mailing list drakma-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/drakma-devel
-- http://nandz.blogspot.com http://foodieforlife.blogspot.com
On Fri, 9 Feb 2007 18:49:29 +0530, "Saurabh Nanda" saurabhnanda@gmail.com wrote:
If ":redirect nil" is set and the server responds with a Set-Cooke: header and an HTTP redirect, will the cookie be set?
I noticed that when the header is the following the cookie is set -- "Set-Cookie: cookie-name=some-randome-value"
But when the header is the following, the cookie is not set -- "Set-Cookie: cookie-name="
Is this correct, or is it some bug in my tests?
The cookie should be set, with an empty string as its value. The value of :REDIRECT should not affect this.
If it's not set, it's an error in Drakma and I'd be happy if you could send me a test case to reproduce it.