On Wed, 12 Jun 2024, Ali Nasir via curl-library wrote:

I have a question about the HTTP headers. The use case is a file
transfer using multipart form data. We have a custom header to send. For
example Shoe-Size: 10.
When we set this header using:
  list = curl_slist_append(list, "Shoesize: 10");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, list);
then i notice that the libcurl does not set the Content-Type and
Content-Length: headers.

This does not match the intended, tested or documented behavior.

Easily verified with this:

  curl -H "Shoesize: 10" -d moo -v localhost

... sends both Content-Length and Content-Type correctly.

If we set some custom header, why does libcurl remove the content headers?

If you can give us a small stand-alone example reproducing this, maybe we can figure out what's going on!

--

 / daniel.haxx.se
 | Commercial curl support up to 24x7 is available!
 | Private help, bug fixes, support, ports, new features
 | https://curl.se/support.html
--
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
  • HTTP headers Ali Nasir via curl-library
    • Re: HTTP headers Daniel Stenberg via curl-library

Reply via email to