mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-19 19:10:17 +00:00
fix json indent
This commit is contained in:
parent
1f8212dadf
commit
e4130ad12e
@ -217,7 +217,7 @@ static bool libhv_HttpClient__send_request(py_Ref arg_self,
|
||||
return ValueError("HttpClient: data and json cannot be set at the same time");
|
||||
}
|
||||
|
||||
if(!py_json_dumps(arg_json)) return false;
|
||||
if(!py_json_dumps(arg_json, 0)) return false;
|
||||
req->body = py_tostr(py_retval());
|
||||
req->headers["Content-Type"] = "application/json";
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ static bool libhv_HttpServer_dispatch(int argc, py_Ref argv) {
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
if(!py_json_dumps(object)) return false;
|
||||
if(!py_json_dumps(object, 0)) return false;
|
||||
c11_sv sv = py_tosv(py_retval());
|
||||
ctx->response->String(std::string(sv.data, sv.size));
|
||||
ctx->response->SetContentType(APPLICATION_JSON);
|
||||
|
Loading…
x
Reference in New Issue
Block a user