curl-users
Re: problem with HTTPS post of file: "Expectation failed"
Date: Thu, 24 Nov 2005 19:43:55 -0800
I'm sorry if I am being dense, but when I run with --trace-ascii, I see
this:
0095: Accept: */*
00a2: Cookie: _session_id=9d7d245d2f5103092266f026e870ba2b
00d8: Content-Length: 137114
00f0: Expect: 100-continue
0106: Content-Type: multipart/form-data; boundary=--------------------
0146: --------edadd7db6abb
015c:
<= Recv header, 33 bytes (0x21)
Am I wrong in thinking that it is truncating the entire message sent to the
server? Obviously this would be useful because I am sending a large file
and don't really care to see 2 MB of base64 encoded characters, but I would
prefer to see at least the first few hundred to verify that my message is
proper. I am using this command:
curl -b jar.txt -c jar.txt --trace-ascii trace.txt -k -F
"episode[title]=Upload" -F "episode[description]=uploaded description" -F
"episode_mp3_file=@small.mp3" -F "episode[title]=Upload"
https://podasp.com/episode/create
So I would expect to see something like:
Content-Type: multipart/form-data;
boundary=---------------------------6243430617906378141649257231
Content-Length: 5731505
-----------------------------6243430617906378141649257231
Content-Disposition: form-data; name="episode[title]"
Upload
...
But, I don't see anything past the boundary marker. Am I misunderstanding
the output from trace, or is trace indicating that I am not providing the
proper switches to curl to add those items to the form submission?
Thanks,
Chris
On 11/24/05, Daniel Stenberg <daniel_at_haxx.se> wrote:
>
> On Thu, 24 Nov 2005, Chris Dawson wrote:
>
> > I've noticed from the trace output that there is a header called
> "Expect:
> > 100-continue" Does this sound like something that could be causing the
> > server to respond with "Expectation failed?" I don't see anything on
> the
> > curl man page to turn this on or off; can anyone explain what this is
> used
> > for?
>
> You can turn off all(*) headers with -H, including that one. It is used to
> basically tell the server we support 100-continue headers fine.
>
> > And, is there a way to get more of the output of the multipart form
> post?
>
> --trace and --trace-ascii give you the lot.
>
> (*) = it is not recommended to turn off random headers without you knowing
> what you're doing _and_ I've been told that there is a bug if you
> try
> to remove Content-Length: from a POST request (which no sane person
> would do anyway...)
>
> --
> Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
>
Received on 2005-11-25