Speed up method_for_uri()

Prepare a regex in advance that handles all POST APIs with a single
search() call.
Add a test for method_for_uri()
Merge pull request #255 from bbolli/speedup-method-for-uri

Speedup `method_for_uri()`