{"id":97,"date":"2008-09-06T23:24:15","date_gmt":"2008-09-06T14:24:15","guid":{"rendered":"http:\/\/www.typea.info\/blog\/index.php\/2008\/09\/06\/google_app_engine_http_form_12\/"},"modified":"2008-09-06T23:24:15","modified_gmt":"2008-09-06T14:24:15","slug":"google_app_engine_http_form_12","status":"publish","type":"post","link":"https:\/\/www.typea.info\/blog\/index.php\/2008\/09\/06\/google_app_engine_http_form_12\/","title":{"rendered":"Google App Engine Http Form\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u53d6\u5f97 \u91ce\u671b(1.2)"},"content":{"rendered":"<p>Http Form \u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u51e6\u7406\u3002<\/p>\n<p>\u4ee5\u4e0b\u53c2\u7167\u3002<\/p>\n<ul>\n<li>POST\u30e1\u30c3\u30bb\u30fc\u30b8\u30cf\u30f3\u30c9\u30e9 <\/li>\n<li>HTML\u7279\u6b8a\u6587\u5b57\u306e\u30a8\u30b9\u30b1\u30fc\u30d7 <\/li>\n<li>FORM\u30d1\u30e9\u30e1\u30fc\u30bf\u53d6\u5f97 <\/li>\n<\/ul>\n<pre class=\"prettyprint linenums\">import cgi \r\nimport wsgiref.handlers \r\n\r\nfrom google.appengine.api import users \r\nfrom google.appengine.ext import webapp \r\n\r\nclass MainPage(webapp.RequestHandler): \r\n    def get(self): \r\n        self.response.out.write(&quot;&quot;&quot; \r\n        &lt;html&gt; \r\n          &lt;body&gt; \r\n            &lt;form action=&quot;\/msg&quot; method=&quot;post&quot;&gt;  \r\n              name:&lt;input type=&quot;text&quot; name=&quot;name&quot; value=&quot;&quot;&gt;&lt;br&gt; \r\n              msg :&lt;textarea name=&quot;message&quot;&gt;&lt;\/textarea&gt;&lt;br&gt; \r\n              &lt;input type=&quot;submit&quot;&gt; \r\n            &lt;\/form&gt; \r\n          &lt;\/body&gt; \r\n        &lt;\/html&gt; \r\n        &quot;&quot;&quot;) \r\n\r\nclass MessagePage(webapp.RequestHandler): \r\n    def post(self): # POST\u30e1\u30c3\u30bb\u30fc\u30b8\u30cf\u30f3\u30c9\u30e9 \r\n        self.response.out.write('&lt;html&gt;&lt;body&gt;') \r\n        self.response.out.write('name:'  \r\n              + cgi.escape( # HTML\u7279\u6b8a\u6587\u5b57\u306e\u30a8\u30b9\u30b1\u30fc\u30d7 \r\n                   self.request.get('name')) # FORM\u30d1\u30e9\u30e1\u30fc\u30bf\u53d6\u5f97 \r\n              + '&lt;br&gt;') \r\n        self.response.out.write('message:&lt;pre&gt;'  \r\n              + cgi.escape( \r\n                   self.request.get('message'))  \r\n              + &quot;&lt;\/pre&gt;&quot;) \r\n        self.response.out.write('&lt;\/body&gt;&lt;\/html&gt;') \r\ndef main(): \r\n    application = webapp.WSGIApplication( \r\n                                         [('\/', MainPage), \r\n                                          ('\/msg', MessagePage)], \r\n                                          debug=True \r\n                                         ) \r\n    wsgiref.handlers.CGIHandler().run(application) \r\n\r\nif __name__ == &quot;__main__&quot;: \r\n    main() <\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Http Form \u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u51e6\u7406\u3002 \u4ee5\u4e0b\u53c2\u7167\u3002 POST\u30e1\u30c3\u30bb\u30fc\u30b8\u30cf\u30f3\u30c9\u30e9 HTML\u7279\u6b8a\u6587\u5b57\u306e\u30a8\u30b9\u30b1\u30fc\u30d7 FORM\u30d1\u30e9\u30e1\u30fc\u30bf\u53d6\u5f97 import cgi import wsgiref.handlers from goo [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"","vkexunit_cta_each_option":"","footnotes":""},"categories":[16,19,20],"tags":[],"class_list":["post-97","post","type-post","status-publish","format-standard","hentry","category-eclipse","category-googleappengine","category-python"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/97","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=97"}],"version-history":[{"count":0,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/97\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=97"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=97"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=97"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}