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.

Comments

christianchristensen’s picture

StatusFileSize
new1.48 KB

Please see attached patch.

Status: Needs review » Needs work

The last submitted patch, services-request_method-1691638-1-D6.patch, failed testing.

ygerasimov’s picture

Please advise when do we need to use separately defined method requestMethod() you are creating with your patch? Can you advise example for this?

christianchristensen’s picture

@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.

ygerasimov’s picture

Version: 6.x-3.1 » 7.x-3.x-dev
Status: Needs work » Needs review

Alright. 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.

ygerasimov’s picture

Status: Needs review » Needs work

The last submitted patch, services-request_method-1691638-1-D6.patch, failed testing.

kylebrowning’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, services-request_method-1691638-1-D6.patch, failed testing.

kylebrowning’s picture

Status: Needs work » Closed (won't fix)

If this wants to be committed for d6 it needs a d7 patch. Reopen when you get one.