mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +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");
|
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->body = py_tostr(py_retval());
|
||||||
req->headers["Content-Type"] = "application/json";
|
req->headers["Content-Type"] = "application/json";
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ static bool libhv_HttpServer_dispatch(int argc, py_Ref argv) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
if(!py_json_dumps(object)) return false;
|
if(!py_json_dumps(object, 0)) return false;
|
||||||
c11_sv sv = py_tosv(py_retval());
|
c11_sv sv = py_tosv(py_retval());
|
||||||
ctx->response->String(std::string(sv.data, sv.size));
|
ctx->response->String(std::string(sv.data, sv.size));
|
||||||
ctx->response->SetContentType(APPLICATION_JSON);
|
ctx->response->SetContentType(APPLICATION_JSON);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user