cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: What is the best way to debug this?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 15 Jul 2012 23:00:47 +0200 (CEST)

On Sun, 15 Jul 2012, Igor Korot wrote:

> post = curl_slist_append( post, "Content-Type: multipart/form-data" );

Why not use CURLOPT_HTTPPOST then? Helps you with all the tricky details...
See http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTHTTPPOST

Also, that content-type looks wrong. It is supposed to include the boundary
string too there.

> post = curl_slist_append( post, "Expect: 100-continue" );

... and libcurl adds this header when it deems it necesary.

> post = curl_slist_append( post, "Connection: keep-alive" );

This isn't necessary really. Unless you're talking to some really ancient
server.

> POST </my_dir>/Default.aspx HTTP/1.1

...

> < HTTP/1.1 100 Continue
> < HTTP/1.1 500 Internal Server Error

This is a broken server. It is often the Expect: header that confuses stupid
servers...

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-07-15