Reputation: 113
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.
Upvotes: 2
Views: 1250
Reputation: 3678
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
Upvotes: 2