Fixes #2864328; improves the function by a request method check and throws error if necessary.
Authored by: d_haase 2009-10-06
Parent: [r547]
Child: [r549]