4.4Keeping the Default Content-Type of the Content

Created on Aug 17, 2026~1 min read

When integrating with some older HTTP services, the Content-Type of the multipart form content should not be set when submitting form data, otherwise it may cause exceptions. Modern HTTP interfaces, however, do not have this limitation. Therefore, by default, when submitting form data, the framework automatically removes the Content-Type of the multipart form content.

If you need to disable this behavior, you can configure it as follows:

cs
HttpRequestBuilder.Post("https://furion.net")    .SetMultipartContent(multipart =>    {        multipart.OmitContentType = false; // Keep the default Content-Type of the multipart content        // Or use multipart.SetOmitContentType(false);    });// [Recommended] Use the SetMultipartContent(Action<HttpMultipartFormDataBuilder> configure, bool omitContentType) overloadHttpRequestBuilder.Post("https://furion.net/")    .SetMultipartContent(multipart =>    {        // ...    }, false);  // Keep the default Content-Type of the multipart content