cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: get error (fwd)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 24 May 2002 10:15:16 +0200 (MET DST)

Forwarded to the list.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
---------- Forwarded message ----------
Date: Fri, 24 May 2002 16:09:58 +0800
From: Li Zhao <sg_lizhao_at_yahoo.com.sg>
To: Daniel Stenberg <daniel_at_haxx.se>
Subject: Re: get error
Sorry for not provide enough information, added below
> On Fri, 24 May 2002, Li Zhao wrote:
>
> > the codes below can't work, who can tell me why, highly appreciate.
>
> Ok, so here we go. We can't give you many answers without you giving us a
> more complete picture of what we're looking at:
>
> 1. What libcurl version on what platform?
   I am using curllib7.9.7 with visualc++6. I let curllib post form data to
a mail server(www.ziplip.com),
 it's worked and redirect an url which return:
<html>
<head>
<script language="javascript">
function init() {
  top.location =
"/ps/PmApp/zlp_dummy?uc=mckAFJMWTH5SRJPJNP00S3JRMD1LKTUDH4DZGUIDT4&NextPage=
/ZLPlus/ui/html/en/framesMain.jsp";
}
</script>
</head>
<body onload="javascript:init()">
</body>
</html>
   then i extracted the url(refer as MAILURL) from it.
> 2. What happened?
  i used command:
    curl MAILURL
it worked OK, return a html file.
> 3. What didn't happen?
but when i used codes below to implement what curl has done, i meet problem:
it just return 0x0D0A0D0A. i don't know why?
int main(void)
{
  CURL *curl;
  CURLcode res;
  char
*i="https://www.ziplip.com/ps/PmApp/zlp_dummy?uc=mckPZX0EACRKU0VQHOVCSSWPYEC
CRZLYGKTD0RLH0&NextPage=/ZLPlus/ui/html/en/framesMain.jsp";
  curl = curl_easy_init();
  if(curl) {
    curl_easy_setopt(curl, CURLOPT_URL, i);
    curl_easy_setopt(curl, CURLOPT_VERBOSE , TRUE);
 //curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE,
strlen("uc=mckAAECABEH552CEDNPCUEDMBAHXZOWXZ4TL2H4WQVO&NextPage=/ZLPlus/ui/h
tml/en/framesMain.jsp"));
 res = curl_easy_perform(curl);
    /* always cleanup */
    curl_easy_cleanup(curl);
  }
  return 0;
}
> 4. How does your protocol dump look like? (CURLOPT_VERBOSE set TRUE)
> 5. Did you receive any headers? If so, what did they look like?
>
> And as a comparison, you say that you succeeded with the curl command
line,
> then you can use -v and -i using that, to compare with 4 and 5 above, as
they
> should be pretty similar.
>
i have compared them:
my code dump:
> GET
/ps/PmApp/zlp_dummy?uc=mckPZX0EACRKU0VQHOVCSSWPYEHMCCRZLYGKTD0RLH0&NextPag
e=/ZLPlus/ui/html/en/framesMain.jsp HTTP/1.1
Host: www.ziplip.com
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
* Connection #0 left intact
* Closing connection #0
and curl.exe dump
> GET
/ps/PmApp/zlp_dummy?uc=mckPZX0EACRKU0VQHOVCSSWPYEHMCCRZLYGKTD0RLH0&NextPag
e=/ZLPlus/ui/html/en/framesMain.jsp HTTP/1.1
User-Agent: curl/7.9.7 (win32) libcurl 7.9.7 (OpenSSL 0.9.6d)
Host: www.ziplip.com
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Fri, 24 May 2002 07:53:52 GMT
Connection: Keep-alive
Cache-Control: no-cache
Content-Type: text/html; charset=ISO-8859-1
Content-Length: 1263
could you tell me why they are diffrent? thank you for your advice.
> We've not yet developed our mind-reading capabilities, so I'm afraid we're
> still in this basic put-stuff-in-emails phase...
>
> --
>     Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
Received on 2002-05-24