0

クライアントリクエストの日時を知る必要があります。

[私は]これらの情報はポストhttpリクエストのヘッダー部分に埋め込まれていると思います。

では、webapp2.RequestHandlerクラスでそれらを取得するにはどうすればよいですか?

class GetPostHeaderFields(webapp2.RequestHandler):
    def post(self):
        <date or time or datetime whatever> = ???

助けのためのタンク。

4

1 に答える 1

0

It depends on the framework you are using. In case of webapp2 it is available as a dictionary object in request.headers . See link

class MyHandler(webapp2.RequestHandler):
    def post(self):
        name = self.request.get('name')
        #Access request headers here
        request.headers['Cookie'] = 'test=value' #Could be anything like Authorization, etc

In case of Django you can access it as a dictionary object in request.META, See here

于 2012-10-28T12:15:36.767 に答える