httpPost

fun httpPost(endpoint: String, jsonBody: String, timeoutMs: Int, port: Int = defaultPort()): String

Sends a POST request to the LLAMA-Server and returns the response body.

Return

The response body as a String.

Parameters

endpoint

The API endpoint path (e.g., /v1/chat/completions).

jsonBody

The JSON request body.

timeoutMs

Read timeout in milliseconds.

port

Optional port override. Defaults to the current server port.

Throws

on non-2xx responses.