Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
AWS 的 SNS POSTsa json 正文,但将CONTENT-TYPE标头设置为text/plain. 有没有办法让 hug 像解释text/plain一样解释,application/json这样我就可以让它为我做解析和验证?
POST
CONTENT-TYPE
text/plain
application/json
您可以将“text/plain”的输入格式处理程序替换为处理 json 的处理程序,如下所示:
api = hug.API(__name__) api.http.set_input_format('text/plain', hug.input_format.json)