Re: Simple RESTful API - make a patch

Tim Roberts <[email protected]> Thu, 10 Nov 2016 09:50:11 -0800
Newsgroups gmane.comp.python.cherrypy
Organization Providenza & Boekelheide, Inc.
Message-ID <[email protected]>
Kearney Taaffe wrote:
> I'm making an API in CherryPy. I must admit, it's super easy, and I'd
> like to turn this example into something that the CherryPy community
> puts on it's website as a "how to API"
>
> The problem I'm having is how to handle an HTTP PATCH request. The
> following code fails with the error for HTTP PATCH requests
>
>     AttributeError: 'Request' object has no attribute 'json'
>

I've never used the JSON tool, but I can't help but notice this:

|    cherrypy.response.headers["Access-Control-Allow-Methods"]=(
        'GET, POST, PUT, DELETE, OPTIONS'
    )
|...
|    defOPTIONS(self):
        return'Allow: DELETE, GET, HEAD, OPTIONS, POST, PUT'
|
Neither of those lists include PATCH.

-- 
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.

-- 
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To post to this group, send email to cherrypy-users-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.