Currently there are several fallbacks inside of RESTServer to properly process the HTTP request method: $_SERVER['REQUEST_METHOD']. I believe this logic should be exposed so others can take advantage of the fallbacks being used internally.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | services-request_method-1691638-1-D6.patch | 1.48 KB | christianchristensen |
Comments
Comment #1
christianchristensen commentedPlease see attached patch.
Comment #3
ygerasimov commentedPlease advise when do we need to use separately defined method requestMethod() you are creating with your patch? Can you advise example for this?
Comment #4
christianchristensen commented@ygerasimov I wanted access to the REQUEST_METHOD value in a custom services script (specifically: I was using update to perform validation on delete: related issue: #1691634). Similarly to how drupal core wraps some of the server super globals, like request_uri, I figured this is another good opportunity as there is some logic trapped in REQUEST_METHOD to even allow something like "? _method=DELETE" which would need to be replicated to work properly. Pulling this out to its own method gives others access to this logic.
Comment #5
ygerasimov commentedAlright. Thank you for the explanation. Lets make patch against 7.x-3.x-dev first and then backport.
Lets test maybe patch will apply without changes.
Comment #6
ygerasimov commented#1: services-request_method-1691638-1-D6.patch queued for re-testing.
Comment #8
kylebrowning commented#1: services-request_method-1691638-1-D6.patch queued for re-testing.
Comment #10
kylebrowning commentedIf this wants to be committed for d6 it needs a d7 patch. Reopen when you get one.