cURL / Mailing Lists / curl-users / Single Mail

curl-users

problem with HTTPS post of file: "Expectation failed"

From: Chris Dawson <xrdawson_at_gmail.com>
Date: Tue, 22 Nov 2005 17:00:27 -0800

I am trying to make a post to an HTTPS server with curl. The server
requires me to login and store a session cookie which I can then use on
subsequent requests, and this works fine. I cannot make a file post,
however, and am unsure why. I used --trace trace.txt and this provides me
with a trace file that indicates the server has responded with "Expectation
failed." I don't really know what to make of this.

More context: the form which I am posting to has several variables which I
think I need to post as well. So, the form looks like this:

<form>
<input type="text" name="episode[title]">
<input type="text" name="episode[description]">
<input type="file" name="episode_mp3_file">
<submit>
</form>

The command I am using for curl is this:
 curl -b jar.txt -c jar.txt --trace trace.txt -k -F "episode_mp3_file=@
small.mp3" https://podasp.com/episode/create

Can someone help me understand what the "Expectation failed" message means?
Does this indicate that I am not sending the form variables "episode[title]"
for example? I think the server does require at least some of these
variables in order to process the request, but this error message seems to
me to be before the upload even begins, so I wonder how the server knows to
do this.

I tried to post form variables alongside the file post (with -d
"episode[title]=Upload") but I got a complaint: "You can only select one
HTTP request!"

The trace file is posted here:
http://webcastinabox.com/projects/podasp/trace.txt

Thanks,
Chris
Received on 2005-11-23