Two GET methods with different query parameters

前端 未结 4 558
星月不相逢
星月不相逢 2020-12-31 10:19

Could we create the same GET URI but with different query parameters?

For example, I have two REST GET URIs:

/questions/ask/?type=rest
/questions/ask         


        
4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-31 11:08

    You cannot overload REST requests.

    In your business layer you would have to check which of the two variables are set and then you will have to do the required processing.

提交回复
热议问题