C# – How to send a file with HttpClient

In order to send a file in a request with HttpClient, add the file into a MultipartFormDataContent object, and send this object as the request content. Here’s an example: This sends the following multipart/form-data POST request: In this article, I’ll explain a few details about MultipartFormDataContent, and show a few other file-sending scenarios. MultipartFormDataContent Add() … Read more