3.14Setting File Content

Created on Aug 17, 2026~2 min read

Sets file content from a local path or internet address, automatically detecting the file name and Content-Type.

cs
// Sets a local fileHttpRequestBuilder.Post("https://furion.net/")    .SetFileContent(@"C:\Users\Furion\test.png");// Sets a local file and specifies the file name and content typeHttpRequestBuilder.Post("https://furion.net/")    .SetFileContent(@"C:\Users\Furion\test.png", "avatar.png", "image/png");// Sets an internet fileHttpRequestBuilder.Post("https://furion.net/")    .SetFileContent("https://furion.net/files/test.png");// Sets an internet file and specifies custom request configurationHttpRequestBuilder.Post("https://furion.net/")    .SetFileContent("https://furion.net/files/test.png",        configure: request =>        {            request.Headers.TryAddWithoutValidation("custom-key", "custom-value");        });