Skip to content

Commit 1fd5612

Browse files
committed
fix: change server methods
1 parent 6b812e1 commit 1fd5612

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/server/server.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,11 @@ int main(int argc, char** argv) {
200200
};
201201

202202
svr->Post("/loadmodel", handle_load_model);
203-
svr->Get("/unloadmodel", handle_unload_model);
203+
// Use POST since httplib does not read request body for GET method
204+
svr->Post("/unloadmodel", handle_unload_model);
204205
svr->Post("/v1/chat/completions", handle_completions);
205206
svr->Post("/v1/embeddings", handle_embeddings);
206-
svr->Get("/modelstatus", handle_get_model_status);
207+
svr->Post("/modelstatus", handle_get_model_status);
207208

208209
LOG_INFO << "HTTP server listening: " << hostname << ":" << port;
209210
svr->new_task_queue = [] {

0 commit comments

Comments
 (0)