cURL / Mailing Lists / curl-users / Single Mail

curl-users

Problem with Header "Expect:" and lighttpd and PHP

From: Pierre <junk_at_regne.net>
Date: Sat, 24 Dec 2005 14:16:12 +0100

Hello

I am scripting a little POST form submit in PHP.

I tryied to make all work in command line first.

After some seeks , I succedeed with the line :

curl-7.15.1>curl -F "fileupload=@g3829.png;
type=image/png" -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8)
Gecko/2
0051111 Firefox/1.5" -H "Expect:" --trace-ascii debug.txt
imageshack.us/index.ph
p

before, I had this error in my debug file :

00c6: Content-Type: multipart/form-data; boundary=--------------------
0106: --------0b61bb565673
011c:
<= Recv header, 33 bytes (0x21)
0000: HTTP/1.1 417 Expectation Failed

I've read the archive then used -H "Expect:" and this fixed all.

But now, I try to do the same in PHP with the line

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "Expect:");

( added to my script ), which work for apache, not on 0000: Server:
lighttpd/1.4.8

Figuring that was the problem, but this is not working more, The
requested web server returns me :

501 - Not Implemented

Must I pass some additional options ??

> this is all working fine in command line, I don't know what I miss now.

Thank you.

Pierre
Received on 2005-12-24