Tag: asp.net-core-webapi

64 votes
5 answers
1.8K views
How to return a specific status code and no contents from Controller?

I want the example controller below to return a status code 418 with no contents. Setting the status code is e

avatar
Wei
0 1 0 9
asked 07 September, 2021
60 votes
3 answers
1.7K views
Return file in ASP.Net Core Web API

Problem I want to return a file in my ASP.Net Web API Controller, but all my approaches return the HttpRespon

avatar
Corrin
0 1 0 9
asked 07 September, 2021
58 votes
12 answers
924 views
ASP.NET Core return JSON with status code

I'm looking for the correct way to return JSON with a HTTP status code in my .NET Core Web API controller

avatar
Robyn
0 1 0 9
asked 07 September, 2021