python中各个代码的意思_python中这段代码的意思

importwsgiref.handlers,urlparsefromgoogle.appengine.extimportwebappfromgoogle.appengine.apiimporturlfetchclassMainPage(webapp.RequestHandler):defpost(self):headers={'Cont...

import wsgiref.handlers, urlparsefrom google.appengine.ext import webappfrom google.appengine.api import urlfetchclass MainPage(webapp.RequestHandler): def post(self): headers={'Content-Type':'application/xml'} data = urlfetch.fetch(' http://server4.operamini.com', payload=self.request.body, method=urlfetch.POST, headers=headers) self.response.status = data.status_code self.response.headers.add_header('Content-Type', 'application/octet-stream') self.response.headers.add_header('Cache-Control', 'private, no-cache') self.response.out.write(data.content) def get(self): self.response.status = '200 OK' self.response.headers.add_header('Content-Type', 'text/html') self.response.out.write('This is Opera Mini Server Proxy!')def main():    application = webapp.WSGIApplication( [(r'/.*', MainPage)], debug=True)    wsgiref.handlers.CGIHandler().run(application)if __name__ == "__main__":    main()这段代码的意思主要是什么?

展开

你可能感兴趣的:(python中各个代码的意思)