HTTPQUERY
Español

203 Non-Authoritative Information

Uso

El código de estado 203 Non-Authoritative Information confirma, en primer lugar, que la solicitud se completó con éxito. El código de estado original no se conserva. El cliente no tiene forma de saber si el servidor de origen devolvió 200, 201 u otro código de éxito.

Nota

Por este motivo, a veces se desaconseja el uso del código de estado 203 Non-Authoritative Information. La ya obsoleta cabecera Warning con el código 214 (Transformation Applied) sirvió en su día como alternativa, pues señalaba una transformación conservando el código de estado original. La cabecera Warning se eliminó del estándar HTTP.

Ejemplo

El cliente solicita un recurso a través de un servidor proxy intermedio. El servidor de origen almacena el recurso como texto plano. El proxy transforma el recurso a formato JSON antes de reenviar la respuesta al cliente.

Solicitud

GET /instructions HTTP/1.1
Host: example.com

Respuesta del servidor de origen

HTTP/1.1 200 OK
Content-Type: text/plain; charset=UTF-8
Content-Length: 250

<message body in text format>

Respuesta del proxy al cliente

HTTP/1.1 203 Non-Authoritative Information
Content-Type: application/json
Content-Length: 265

{"response":"<message body embedded in JSON>"}

Enfoque alternativo (heredado)

Obsoleto

La cabecera Warning quedó obsoleta y hoy es un recurso heredado. Este enfoque no se recomienda para nuevas implementaciones.

En lugar de usar el código de estado 203 Non-Authoritative Information, el proxy añade una cabecera Warning con el código 214 (Transformation Applied), lo que conserva el código de estado original.

Respuesta del proxy usando la cabecera Warning

HTTP/1.1 200 OK
Content-Type: application/json
Warning: 214 proxy.example.re "Response converted to JSON format"
Content-Length: 265

{"response":"<message body embedded in JSON>"}

Cuando se usa una cabecera Warning en lugar del código de estado 203 Non-Authoritative Information, el código de estado original se conserva y el cliente trata la respuesta en consecuencia.

Referencias de código

.NET

HttpStatusCode.NonAuthoritativeInformation

Rust

http::StatusCode::NON_AUTHORITATIVE_INFORMATION

Rails

:non_authoritative_information

Go

http.StatusNonAuthoritativeInfo

Symfony

Response::HTTP_NON_AUTHORITATIVE_INFORMATION

Python3.5+

http.HTTPStatus.NON_AUTHORITATIVE_INFORMATION

Java

java.net.HttpURLConnection.HTTP_NOT_AUTHORITATIVE

Apache HttpComponents Core

org.apache.hc.core5.http.HttpStatus.SC_NON_AUTHORITATIVE_INFORMATION

Angular

@angular/common/http/HttpStatusCode.NonAuthoritativeInformation