© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
1 reply
DiamondKesha

Send image to API with HttpClient Post

Hello. How to correct send image to api? Used several ways, but for some reason I get BadRequest. In API documentation they use this example nodejs code:
await fetch("url", {
method: "POST",
body: fs.readFileSync("demo.jpg"),
headers: { "Content-type": "image/jpeg" },
}).then((e) => e.json());
unknown.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ HTTPclient fails to POST properly
C#CC# / help
3y ago
Send by value in Body with HttpClient class
C#CC# / help
3y ago
✅ MAUI on Android - problem with HttpClient Post Method
C#CC# / help
2y ago
❔ Excell send to API
C#CC# / help
3y ago