Differences between GET and POST data in CherryPy?

I made the decision between the Python web frames for my project, and I really liked how the lightweight, flexible, and compressed CherryPy compares to others. The only problem I am facing is that I cannot find any documentation on how to distinguish between data sent via GET and POST.

For example, I do not want users to be able to provide their login credentials through a GET request (http://example.com/login?username=user&password=pass), but according to the CherryPy tutorial , all data is sent as method parameters, regardless from which HTTP method they are sent as. Is there a way to say that I only need POST data, or do I need to use MethodDispatcher ?

Thank!

+5
source share
1 answer

See documents .

A string containing an HTTP method, such as "GET" or "POST". Set in the "start" phase.

looks like checking cherrypy.request.method is what you want to do.

+8
source

All Articles