2

I have some patient information to be returned by my API - Name - Gender - Phone Number

This all is the mandatory information needed at UI. What status code should I send to UI in a case when I just can send partial information.

For ex : I could just fetch Name and Gender but no phone number, what should be my status code to be sent back to client with the information I was able to fetch ? Cannot be 200 as the complete information is not sent.

  • Possible duplicate of [HTTP status code for a partial successful request](https://stackoverflow.com/questions/8472935/http-status-code-for-a-partial-successful-request) – jhamon Oct 28 '19 at 15:01

1 Answers1

2

The HTTP 206 Partial Content success status response code indicates that the request has succeeded and has the body contains the requested ranges of data, as described in the Range header of the request.

If there is only one range, the Content-Type of the whole response is set to the type of the document, and a Content-Range is provided.

If several ranges are sent back, the Content-Type is set to multipart/byteranges and each fragment covers one range, with Content-Range and Content-Type describing it.

check here for more details : https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206

Abder KRIMA
  • 3,418
  • 5
  • 31
  • 54