想不通这个,对某人来说应该是一件容易的事。只是收到一个 500 服务器错误回复并期望它显示“成功”。
import webapp2
page = """
<!DOCTYPE html>
<html>
<form method="post">
<input type="hidden" value="success" name="radius" >
<input type="submit">
</form>
</body>
</html>
"""
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.out.write(page)
def post(self):
radius = self.request.get("radius")
self.response.out.write(radius)
app = webapp2.WSGIApplication([('/', MainPage)], debug=True)
app.yaml 如下
application: udatest85
version: 1
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: .*
script: main.app
libraries:
- name: webapp2
version: "2.5.1"