0

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 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.