Flask 简明教程

Flask – Request Object

客户网页中的数据以全局请求对象的形式发送到服务器。为了处理请求数据,应从 Flask 模块导入它。

The data from a client’s web page is sent to the server as a global request object. In order to process the request data, it should be imported from the Flask module.

请求对象的重要属性如下列出:

Important attributes of request object are listed below −

  1. Form − It is a dictionary object containing key and value pairs of form parameters and their values.

  2. args − parsed contents of query string which is part of URL after question mark (?).

  3. Cookies − dictionary object holding Cookie names and values.

  4. files − data pertaining to uploaded file.

  5. method − current request method.