mirror of
https://gitee.com/xia-chu/ZLMediaKit.git
synced 2026-05-25 11:07:50 +08:00
http api请求有json body才解析
This commit is contained in:
parent
0ead9b6945
commit
725fdf1786
@ -225,6 +225,7 @@ ApiArgsType getAllArgs(const Parser &parser) {
|
||||
allArgs[pr.first] = strCoding::UrlDecodeComponent(pr.second);
|
||||
}
|
||||
} else if (parser["Content-Type"].find("application/json") == 0) {
|
||||
if (!parser.content().empty()) {
|
||||
try {
|
||||
stringstream ss(parser.content());
|
||||
Value jsonArgs;
|
||||
@ -236,6 +237,7 @@ ApiArgsType getAllArgs(const Parser &parser) {
|
||||
} catch (std::exception &ex) {
|
||||
WarnL << ex.what();
|
||||
}
|
||||
}
|
||||
} else if (!parser["Content-Type"].empty()) {
|
||||
WarnL << "invalid Content-Type:" << parser["Content-Type"];
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user