Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import web
- import simplejson as json
- urls = (
- '/', 'index',
- '/url', 'url',
- '/math', 'math'
- )
- class index:
- def GET(self):
- return 'hello, world'
- class url:
- def GET(self):
- return 'url'
- class math:
- def GET(self):
- return 'do math'
- def POST(self):
- data = web.data()
- j = json.loads(data)
- print j
- return j['a']+j['b']
- if __name__ == "__main__":
- app = web.application(urls, globals())
- app.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement