cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: 405 yet not resolved

From: Hisseine Dj. <djandabri_at_sympatico.ca>
Date: Wed, 26 Jun 2002 10:21:16 -0400

>Now how do I specify a GET Method for curl_perform() on the URL

Try your code without this option.
curl_easy_setopt(curl, CURLOPT_HTTPGET, TRUE);

Remove the line ...

If I am not wrong, by default the perform action will try GET.

Hisseine
  ----- Original Message -----
  From: Chirag
  To: curl-library_at_lists.sourceforge.net
  Sent: Wednesday, June 26, 2002 10:07 AM
  Subject: 405 yet not resolved

  Hi,

    I have given the following options in Curl C API (Linux)

   curl_easy_setopt(curl, CURLOPT_URL, url);
   curl_easy_setopt(curl, CURLOPT_VERBOSE, TRUE);
   curl_easy_setopt(curl, CURLOPT_HEADER, TRUE);
   curl_easy_setopt(curl, CURLOPT_HTTPGET, TRUE);
   res = curl_easy_perform(curl);

  I get the following output......

  * Connected to www.xyz.com (202.71.XXX.XXX)
  HEAD / HTTP/1.1
  Host: www.xyz.com:4482
  Pragma: no-cache
  Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*

  HTTP/1.1 405 Method not allowed. Please send your request either by GET or POST method
  Date: 20020626191433218
  Content-Type: text/plain
  Content-Length: 77

  * Connection #0 left intact

  * Closing connection #0
  ----------------------------------------------------------------------

  Now how do I specify a GET Method for curl_perform() on the URL of the form http://www.xyz.com?name1=value1&name2=value2
  Shouldnt CURLOPT_HTTPGET serve the purpose and get the URL contents without giving 405 error ?
  However when I submit the same URL to the browser directly, I get my contents. Only when I try to submit the URL using CURL API, i get the above error.

  Please help.

  Chirag

-------------------------------------------------------
This sf.net email is sponsored by: Jabber Inc.
Don't miss the IM event of the season | Special offer for OSDN members!
JabConf 2002, Aug. 20-22, Keystone, CO http://www.jabberconf.com/osdn
Received on 2002-06-26