你的位置: 码友网首页 / 资讯源列表 / Null API Responses and HTTP 204 Results in ASP.NET Core

关于[Null API Responses and HTTP 204 Results in ASP.NET Core]的摘要:

ASP.NET Core 3.x has a behavior that results in API results that return null from the controller action returning a HTTP 204 - No Content response rather than a null JSON result. Presumably the idea is that if you return null from an API, your intention is to return 'no content' and that sort of make sense in some cases. Except... when you're building an API null may actually have a meaning on the client or the client at minimum may be expecting a proper JSON response.

原文地址: https://weblog.west-wind.com/posts/2020/Feb/24/Null-API-Responses-and-HTTP-204-Results-in-ASPNET-Core

收录时间: 2020-02-25 浏览量: 2122 分类: ASP.NET Core

| 0 收藏 | 0