Rest Standard: Path parameters or Request parameters

前端 未结 6 1531
孤独总比滥情好
孤独总比滥情好 2020-11-29 23:53

I am creating a new REST service.

What is the standard for passing parameters to REST services. From different REST implementations in Java, you can configure param

6条回答
  •  心在旅途
    2020-11-30 00:32

    Paths tend to be cached, parameters tend to not be, as a general rule.

    So...

    GET /customers/bob
    

    vs

    GET /customers?name=bob
    

    The first is more likely to be cached (assuming proper headers, etc.) whereas the latter is likely not to be cached.

提交回复
热议问题