Relative Content

Tag Archive for jsondelphipost

How to get a correct JSON response to a POST request in Delphi?

My program accesses the local Nitro server (API Jan for Windows – https://jan.ai/api-reference#tag/chat/post/chat/completions). I’m trying to write a POST request for the “Create chat completion” API request. This is communication with the AI model. Everything works fine in Python and I get the answer. On Delphi 11.3 I get some strange blocks instead of response. But they contain the necessary data (each block contains 1 word). Although I have to receive the JSON and highlight the response in a “content” object. Here is my code.