Speed up method_for_uri()

Prepare a regex in advance that handles all POST APIs with a single
search() call.