PATCH method

116 views
Skip to first unread message

Matthew Pease

unread,
Jul 18, 2012, 5:51:03 AM7/18/12
to web...@googlegroups.com
Hello -

  I'd like to be a good Google netizen & support the PATCH method in my rest api.   

When I use a route like this:
    webapp2.Route(r'/v1/patch', handler='webHandlers.PatchHandler', handler_method='patch', methods=['PATCH']),

webapp2 just complains:

ERROR    2012-07-18 09:48:32,256 dev_appserver.py:2943] code 501, message Unsupported method ('PATCH')

How can I get PATCH supported?   

ps.  I need this to work on App Engine.

Thank you-
Matt

Mariano Simone

unread,
Apr 11, 2013, 9:43:45 AM4/11/13
to web...@googlegroups.com
You can check http://code.google.com/p/webapp-improved/issues/detail?id=69

To make it work on GAE, you just need to do something like:

# HACK to support PATCH in webapp2.WSGIApplication. Might not be needed if http://code.google.com/p/webapp-improved/issues/detail?id=69 is applied
methods = set(webapp2.WSGIApplication.allowed_methods)
methods.add('PATCH')
webapp2.WSGIApplication.allowed_methods = frozenset(methods)
# END HACK
Reply all
Reply to author
Forward
0 new messages