I have an API which returns a file to the client based on start & end date filters it sends to the server. The server has a MAX_FILE _SIZE config value in order the reduce the amount of data it returns to the client. In case the server is sending a truncated file due to its size what is the appropriate resonse code?
1 Answer
I think HTTP 206 is the one that seems to be most fitting.
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.
1 Comment
Tsahi
So in order to use it correctly I need to send the filters in a Range header instead of a query params? Also I saw that you should send Bytes and not dates. So it it suitable?