Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Help: Removing A Specific Header With cURL
masterio
post Jan 30 2007, 08:14 AM
Post #1


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 21
Joined: 24-September 06
Member No.: 16,119



Hi all,

I' ve problem sending HTTP POST(multipart/form-data) request using CURL. The server always reply with HTTP/1.1 417 Expectation Failed. Then I review my code and the tcp packet using wireshark for long long time sad.gif just to figure out where is the error!. This problem only for one site and for the others site my script works perfectly!.

here is my packet that sent to the server
CODE
POST xxxxxxxx HTTP/1.1
Cookie: PHPSESSID=447c6f5c9e73c22a1bf50dd46940306e
Host: www.xxxxxxxxxx.com
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.xxxxxx.com/
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0
Content-Length: 1096
Expect: 100-continue
(anti-spam-content-type:) multipart/form-data; boundary=----------------------------14293c2adb1d

<< THE DATA >>


And here is the server response
CODE
HTTP/1.1 417 Expectation Failed
Connection: close
Content-Length: 0
Date: Tue, 30 Jan 2007 07:19:41 GMT
Server: lighttpd/1.4.8
Connection: close
Content-Length: 0
Date: Tue, 30 Jan 2007 07:19:41 GMT
Server: lighttpd/1.4.8


After googling for while, i found that the error is not on my code but the server(lighttpd) bug. Based on Daniel Stenberg(http://curl.haxx.se/mail/archive-2005-11/0127.html) we have to remove header (Expect: 100-continue) using command -H "Expect: ". Yeah but it's for curl executable, how to doit on PHP/CURL?. If set up curl_setopt($ch, CURLOPT_POSTFIELDS, $foo) PHP curl always sent Expect Header. I've searching everywhere but i couldn't find useful help. Any body knows what PHP/CURL command to remove certain header that we specified?

Thanks

Rio Astamal smile.gif

This post has been edited by masterio: Jan 30 2007, 08:16 AM
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. How To Remove Bad Sectors Or Bad Clusters From HDD(17)
  2. Bad_pool_header(8)
  3. Msn Contacts Removal(10)
  4. Remove Msn Messenger In Windows Xp(10)
  5. Remove Window Animation - Make It Run Faster(8)
  6. Need Help - How To Remove Session ID From URL(6)
  7. Vertical Text In Datagridview Column Header(6)
  8. Remove Sound From Avi(10)
  9. Spyware 3721(7)
  10. Gcrawler - Providing More Specific Details(2)
  11. Smf Theme Creation Help(13)
  12. PHP-Nuke Header Question(2)
  13. How To Get The Random.h Header(4)
  14. Tutorial: Build Pure CSS Using Online Tools - Part 1(6)
  15. Wordpress To Drupal Migration(0)
  1. How To Download/upload File Through A Ftp Proxy Server With 'curl'(3)
  2. How To Remove Query String Using Regular Expressions(4)
  3. [help] Vista - Remove White Selection Highlight From Icons(11)
  4. Problem With Form Elements(3)
  5. Prevent Specific Applications From Connecting To The Internet(2)
  6. Browser Game Specific Non N00b Question(17)
  7. Afs Adapter Problem(4)
  8. Safari Island De Luxe : Where Are The High Scores ?(0)
  9. "Sighandler_t Typedef" Header(1)
  10. Using Regedit To Remove Viruses(8)
  11. Using Blogger To Add Content(9)
  12. Php Location Header No Send Session Id ?(0)
  13. Remove Windows Update Uninstall Information(4)


 



- Lo-Fi Version Time is now: 13th October 2008 - 07:16 PM