httpPost

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

Invia una richiesta POST al server LLAMA e restituisce il corpo della risposta.

Return

Il corpo della risposta come stringa.

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.