curl-library
Object Moved/Location cut-off ?
Date: Fri, 21 Jun 2002 22:10:49 -0400
OK, I'm trying to use curl to do a simple login to E-bay. Yeah, I know it sounds
stupid, but this is a project that I'm doing to learn how curl deals with cookies
and POSTs/GETs.
I'm using the following curl options:
curl_easy_setopt(plug_args->curl_handle, CURLOPT_COOKIEFILE, "mycookies.fil");
curl_easy_setopt(plug_args->curl_handle, CURLOPT_VERBOSE, TRUE);
curl_easy_setopt(plug_args->curl_handle, CURLOPT_HEADER, TRUE);
The first time I send my info to the side, they send back a cookie (and since
I performed the curl with the curl_easy_setopt(plug_args->curl_handle,
CURLOPT_COOKIEFILE, "mycookies.fil"), I'm assming that enables the cookie
parser as explained in the docs). They also send back an "Object Moved"
header with the "Location:" of where I need to send curl next.
However, the "Location:" seems to be cut off, I only get the following
in the header:
HTTP/1.1 302 Object Moved
Server: Microsoft-IIS/4.0
Date: Sat, 22 Jun 2002 01:56:42 GMT
Connection: close
Location: http://cgi3.ebay.com/aw-cgi/eBayISAPI.dll?
HTTP/1.1 501 Not Implemented
Server: Microsoft-IIS/4.0
Date: Sat, 22 Jun 2002 01:58:23 GMT
Connection: close
There should be a lot more stuff ater the ?, but it's empty.
Here's what I'm sending:
http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?MfcISAPICommand=AdultLogin&userid=%s&password=%s
Just assume that userid and password are legit and work normally through a browser.
So where do I go from here?
I tried to make my own HTTP/HTML handling code, but it got too complicated. I was
hoping curl would help.
Any help would be appreciated.
Sincerely,
GRE
P.S. I got the URL info from a program called Bidwatcher, which does
work properly with E-bay, so the URLs should be valid. I'm also
URL encoding the "password=%s" as they did in the Bidwatcher program.
-- Every creature has within him the wild, uncontrollable urge to punt. ------------------------------------------------------- Sponsored by: ThinkGeek at http://www.ThinkGeek.com/Received on 2002-06-22