【发布时间】:2018-04-13 15:57:02
【问题描述】:
我正在使用webapp2做一个小api。
例如,如果我有:
import webapp2
class Test(webapp2.RequestHandler):
def put(self):
self.response.write("this was a test")
app = webapp2.WSGIApplication([
('/test', Test)
])
我通过 curl 发出请求:
curl --request PUT --header "Content-Type: application/json" --data '{"content": "test"}' http://localhost:8080/test
我将如何访问传入的数据'{"content": "test"}'?
【问题讨论】:
标签: json python-2.7 httprequest put webapp2