Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i get the HTTP headers in a Google App Engine webapp2 requesthandler

How do i access the http headers of the request that calls this method?

class GetDBVersion(webapp2.RequestHandler):
    def get(self):
# writes out db version

in main.py

app = webapp2.WSGIApplication([
    ('/version', GetDBVersion
      # and more methods
like image 531
bogen Avatar asked Nov 30 '25 00:11

bogen


1 Answers

Do this inside the class with webapp2.RequestHandler.

self.request.headers

It will give you a dict of headers.

like image 145
specialscope Avatar answered Dec 02 '25 12:12

specialscope



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!