A HTTP Status Code Details
A.1 HTTP Status Code details
This section describes the HTTP status codes usage on SBI. The
":status
" pseudo header field in HTTP/2 indicates the HTTP status
codes. The status codes are defined in subclause 8.1.2.4 in IETF RFC 7540.
The following table specifies HTTP status codes per HTTP method that is supported on SBI. The support of HTTP status code is categorized as:
- mandatory, which is marked in table as "M". This means that all
3GPP NFs supports the processing of the specific HTTP status code for the specific
HTTP method, when received in an HTTP response message. In such cases the 3GPP NF
also supports the handling of the "ProblemDetails" JSON object with the content-type
header field set to the value "
application/problem+json
" for HTTP status codes 4xx and 5xx, if the corresponding API definition in the related technical specification does not specify another response body for the corresponding status code. - service specific, which is marked in table as "SS" and means that the requirement to process the HTTP status code depends on the definition of the specific API.
- not applicable, which is marked in table as "N/A". This means that the specific HTTP status code is not used for the specific HTTP method within the 3GPP NFs.
HTTP Status Code Supported on SBI
Table A-1 HTTP Status Codes
HTTP Status Code | HTTP Method | ||||
---|---|---|---|---|---|
- | DELETE | GET | PATCH | POST | PUT |
100 Continue | N/A | N/A | N/A | N/A | N/A |
200 OK (NOTE 1) | SS | M | SS | SS | SS |
201 Created | N/A | N/A | N/A | SS | SS |
202 Accepted | SS | N/A | SS | SS | SS |
204 No Content (NOTE 2) | M | N/A | SS | SS | SS |
300 Multiple Choices | N/A | N/A | N/A | N/A | N/A |
303 See Other | SS | SS | N/A | SS | SS |
307 Temporary Redirect | SS | SS | SS | SS | SS |
308 Permanent Redirect | SS | SS | SS | SS | SS |
400 Bad Request | M | M | M | M | M |
401 Unauthorized | M | M | M | M | M |
403 Forbidden | SS | SS | SS | SS | SS |
404 Not Found | SS | SS | SS | SS | SS |
405 Method Not Allowed | SS | SS | SS | SS | SS |
406 Not Acceptable | N/A | N/A | N/A | N/A | N/A |
408 Request Timeout | SS | SS | SS | SS | SS |
409 Conflict | N/A | N/A | SS | SS | SS |
410 Gone | SS | SS | SS | SS | SS |
411 Length Required | N/A | N/A | M | M | M |
412 Precondition Failed | SS | SS | SS | SS | SS |
413 Payload Too Large | N/A | N/A | M | M | M |
414 URI Too Long | N/A | M | N/A | N/A | N/A |
415 Unsupported Media Type | N/A | N/A | M | M | M |
422 Unprocessable Entity | N/A | N/A | SS | N/A | N/A |
500 Internal Server Error | M | M | M | M | M |
501 Not Implemented | SS | SS | SS | SS | SS |
503 Service Unavailable | M | M | M | M | M |
504 Gateway Timeout | SS | SS | SS | SS | SS |
Note:
"200 OK" response used on SBI contains body.- as "204 No Content" if 2xx response does not contain body; and
- as "200 OK" if 2xx response contains body.
NF as HTTP Client
An NF acting as an HTTP server generates HTTP status codes specified in the above table per indicated HTTP method.
An HTTP method which is not supported by 5GC SBI API specification is rejected with the HTTP status code "501 Not Implemented".
Note:
In this case, the NF does not need to include in the HTTP response the "cause" attribute indicating corresponding error since the HTTP status code "501 Not Implemented" itself provides enough information of the error, that is, the NF does not recognize the HTTP method.If the specified target resource does not exist, the NF rejects the HTTP method with the HTTP status code "404 Not Found".
If the NF supports the HTTP method but not by a target resource, the NF rejects the HTTP method with the HTTP status code "405 Method Not Allowed" and includes in the response an Allow header field containing the supported method(s) for that resource.
Note:
In this case, the NF does not need to include in the HTTP response the "cause" attribute indicating corresponding error since the HTTP status code "405 Method Not Allowed" itself provides enough information of the error and hence the Allow header field lists HTTP method(s) supported by the target resource.If received HTTP request contains incorrect optional IE, the NF discards the incorrect IE.
-
The NF as HTTP Server must map application errors to the most similar 3xx/4xx/5xx HTTP status code specified in Table A-2. If no such code is applicable, it should use "400 Bad Request" status code for errors caused by client side or "500 Server Internal Error" status code for errors caused on server side.
-
If the received HTTP request contains an unsupported payload format, the NF rejects the HTTP request with the HTTP status code "415 Unsupported Media Type". If the HTTP PATCH method is rejected, the NF includes the Accept-Patch header field set to the value of supported patch document media types for a target resource. That is, either "application/merge-patch+json" if the NF supports "JSON Merge Patch" or "application/json-patch+json" if the NF supports "JSON Patch". If the HTTP PATCH request received contains "JSON Merge Patch" and "JSON Patch" documents, and the NF supports only one document, the NF ignores the unsupported patch document.
Note:
The format problem might be due to the request's indicated Content-Type or Content-Encoding header fields, or as a result of inspecting the payload body directly. -
If the received HTTP request contains payload body larger than the NF is able to process, the NF rejects the HTTP request with the HTTP status code "413 Payload Too Large".
-
If the result of the received HTTP POST request used for resource creation is as same as the existing resource, the NF rejects the HTTP request with the HTTP status code "303 See Other" and includes a location header field set to the URI of the existing resource in the HTTP response.
HTTP Status Code support in NRF as Server
Table A-2 HTTP Status Code support in NRF as Server
HTTP Status Code | Service Operation | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
- | NFRegister (PUT) | NFUpdate - Full Replacement (PUT) | NFUpdate Partial Replacement (PATCH) | NFUpdate Partial Replacement - Heartbeat(PATCH) | NFDeregister (DELETE) | NFListRetrieval (GET) | NFProfileRetrieval (GET) | NFStatusSubscribe (POST) | NFStatusSubscribe (PATCH) | NFStatusUnSubscribe (DELETE) | NFDiscover (GET) | AccessTokenRequest (POST) |
100 Continue | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A |
200 OK | N/A | Supported | Supported | Supported | N/A | Supported | Supported | N/A | Supported | N/A | Supported | Supported |
201 Created | Supported | N/A | N/A | N/A | N/A | N/A | N/A | Supported | N/A | N/A | N/A | N/A |
202 Accepted | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A |
204 No Content | N/A | N/A | N/A | Supported | Supported | N/A | N/A | N/A | N/A | Supported | N/A | N/A |
300 Multiple Choices | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A |
303 See Other | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A |
307 Temporary Redirect | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported |
308 Permanent Redirect | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported |
400 Bad Request | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported |
401 Unauthorized | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported |
403 Forbidden | N/A | N/A | N/A | N/A | N/A | NotSupported | NotSupported | Supported | N/A | N/A | Supported | N/A |
404 Not Found | N/A | N/A | Supported | Supported | Supported | Supported | Supported | N/A | Supported | Supported | N/A | N/A |
405 Method Not Allowed | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported |
406 Not Acceptable | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A |
408 Request Timeout | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported | NotSupported |
409 Conflict | N/A | N/A | Supported | Supported | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A |
410 Gone | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A |
411 Length Required | NotSupported | NotSupported | NotSupported | NotSupported | N/A | N/A | N/A | NotSupported | NotSupported | N/A | N/A | NotSupported |
412 Precondition Failed | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A |
413 Payload Too Large | NotSupported | NotSupported | NotSupported | NotSupported | N/A | N/A | N/A | NotSupported | NotSupported | N/A | N/A | NotSupported |
414 URI Too Long | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | NotSupported | N/A |
415 Unsupported Media Type | Supported | Supported | Supported | Supported | N/A | N/A | N/A | NotSupported | NotSupported | N/A | N/A | N/A |
422 Unprocessable Entity | N/A | N/A | Supported | Supported | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A |
500 Internal Server Error | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported |
501 Not Implemented | Supported | Supported | Supported | Supported | N/A | N/A | N/A | Supported | N/A | N/A | N/A | N/A |
503 Service Unavailable | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported |
504 Gateway Timeout | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Supported |