|
1 | 1 | --- |
2 | 2 | title: Format response data in ASP.NET Core Web API |
| 3 | +ai-usage: ai-assisted |
3 | 4 | author: tdykstra |
4 | 5 | description: Learn how to format response data in ASP.NET Core Web API. |
5 | 6 | monikerRange: '>= aspnetcore-3.1' |
6 | 7 | ms.author: tdykstra |
7 | 8 | ms.custom: H1Hack27Feb2017 |
8 | | -ms.date: 04/08/2022 |
| 9 | +ms.date: 03/22/2026 |
9 | 10 | uid: web-api/advanced/formatting |
10 | 11 | --- |
11 | 12 | # Format response data in ASP.NET Core Web API |
@@ -97,7 +98,7 @@ If the Accept header contains `*/*`, the Header is ignored unless `RespectBrowse |
97 | 98 | Unlike typical API clients, web browsers supply `Accept` headers. Web browsers specify many formats, including wildcards. By default, when the framework detects that the request is coming from a browser: |
98 | 99 |
|
99 | 100 | * The `Accept` header is ignored. |
100 | | -* The content is returned in JSON, unless otherwise configured. |
| 101 | +* The content is returned using the first registered output formatter that can handle the response type, unless otherwise configured. |
101 | 102 |
|
102 | 103 | This approach provides a more consistent experience across browsers when consuming APIs. |
103 | 104 |
|
@@ -294,7 +295,7 @@ If the Accept header contains `*/*`, the Header is ignored unless `RespectBrowse |
294 | 295 | Unlike typical API clients, web browsers supply `Accept` headers. Web browsers specify many formats, including wildcards. By default, when the framework detects that the request is coming from a browser: |
295 | 296 |
|
296 | 297 | * The `Accept` header is ignored. |
297 | | -* The content is returned in JSON, unless otherwise configured. |
| 298 | +* The content is returned using the first registered output formatter that can handle the response type, unless otherwise configured. |
298 | 299 |
|
299 | 300 | This approach provides a more consistent experience across browsers when consuming APIs. |
300 | 301 |
|
@@ -529,7 +530,7 @@ If the Accept header contains `*/*`, the Header is ignored unless `RespectBrowse |
529 | 530 | Unlike typical API clients, web browsers supply `Accept` headers. Web browsers specify many formats, including wildcards. By default, when the framework detects that the request is coming from a browser: |
530 | 531 |
|
531 | 532 | * The `Accept` header is ignored. |
532 | | -* The content is returned in JSON, unless otherwise configured. |
| 533 | +* The content is returned using the first registered output formatter that can handle the response type, unless otherwise configured. |
533 | 534 |
|
534 | 535 | This approach provides a more consistent experience across browsers when consuming APIs. |
535 | 536 |
|
|
0 commit comments