© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
14 replies
electronic heartbreak.

ASP.NET Core Web API byte[] issues

Hello there,

I am trying to accept a byte array in my API request:
class X {
    public byte[] Test { get; set; }
}
class X {
    public byte[] Test { get; set; }
}


Swagger is used to test the API. When I launch the project and open it in my browser I see that this property accepts a string instead of a byte[]. Googling this issue did not gave much information besides this SO-thread

https://stackoverflow.com/questions/77233543/call-an-api-with-byte-array-in-net-6

My question is if this is good enough or has anyone else faced similar issues?
Stack Overflow
Call an api with byte array in .NET 6
I am creating an ASP.NET Core 6 Web API. I did enable Swagger and would like to test an endpoint with input body of datatype byte[].
[HttpPost(Name = "publishdata")]
public IActionResult ...
Call an api with byte array in .NET 6
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

✅ ASP.Net Core Web API
C#CC# / help
6mo ago
ASP.NET CORE MVC VS ASP.NET CORE WEB API
C#CC# / help
17mo ago
✅ ASP.NET Core Web Api + SignalR
C#CC# / help
2y ago
✅ Testing in ASP.NET Core Web Api
C#CC# / help
9mo ago