MCPcopy Create free account
hub / github.com/TelegramMessenger/cocoon / receive_http_request

Method receive_http_request

runners/client/ClientRunner.cpp:348–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346}
347
348void ClientRunner::receive_http_request(http::HttpCallback::RequestType request_type,
349 std::vector<std::pair<std::string, std::string>> headers, std::string path,
350 std::vector<std::pair<std::string, std::string>> args, std::string body,
351 std::unique_ptr<http::HttpRequestCallback> answer_callback) {
352 if (path == "/v1/models") {
353 if (body.size() != 0) {
354 http_send_static_answer(400, "bad request", std::move(answer_callback));
355 return;
356 }
357 run_get_models_request(std::move(answer_callback));
358 return;
359 }
360
361 run_http_request(request_type, std::move(headers), std::move(path), std::move(args), std::move(body),
362 std::move(answer_callback));
363}
364
365/*
366 *

Callers

nothing calls this directly

Calls 1

run_http_requestFunction · 0.85

Tested by

no test coverage detected