1
0
mirror of synced 2024-11-25 00:00:27 +01:00

fix: Make sure docs question request is always properly formatted

This commit is contained in:
WerWolv 2023-04-10 23:05:44 +02:00
parent 013eaae715
commit 5512585cc5

View File

@ -81,7 +81,8 @@ namespace hex::plugin::builtin {
auto request = HttpRequest("POST", hex::format("https://api.gitbook.com/v1/spaces/{}/search/ask", space));
request.setBody(hex::format(R"({{ "query": "{}" }})", input));
const nlohmann::json body = { { "query", input } };
request.setBody(body.dump());
request.addHeader("Content-Type", "application/json");
auto response = request.execute().get();