#2415·grape

Recognize_path should account for HTTP method

Author: ideaoforderCreated Feb 23, 2024Updated Oct 8, 2024
Labelsfeature request

In a RESTful API, you'll use the same path multiple times, but with a different REST verb.

These will return the same endpoint:

  • GET /orders
  • POST /orders

So will these:

  • GET /orders/123
  • PUT /orders/123
  • DELETE /orders/123

Ideally, we'd be able to pass that in as an option:

ruby
API.recognize_path('/orders/123', method: 'PUT')