REST status code 204 on paginated result

前端 未结 4 727
灰色年华
灰色年华 2021-01-19 05:28

I am designing a REST like API for paginated data retrieval of a YUI-based client. The REST URL looks like this for a GET request:

/app/catalog/data?startInd         


        
4条回答
  •  鱼传尺愫
    2021-01-19 05:50

    I would say 204 is most appropriate. The request was successful, just with no results.

    10.2.5 204 No Content
    
    The server has fulfilled the request but does not need to return an entity-body, and might want to return updated metainformation.
    

    Sounds exactly like the case.

提交回复
热议问题