Home API Manuals About Forum
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

HTTP_Header

Returns the HTTP response body from the last HTTP_Get or HTTP_Post request.

Known bug (kept for backward compatibility): Despite its name, HTTP_Header actually returns the response body, not the headers. The headers are returned by HTTP_Body. This naming swap is a historical bug that has been preserved to avoid breaking existing scripts.

Returns an empty string if no HTTP request has been made or the character is disconnected.

Возвращает тело HTTP-ответа от последнего запроса HTTP_Get или HTTP_Post.

Известный баг (сохранён для обратной совместимости): Несмотря на название, HTTP_Header на самом деле возвращает тело ответа, а не заголовки. Заголовки возвращаются через HTTP_Body. Эта путаница имён — исторический баг, сохранённый, чтобы не ломать существующие скрипты.

Возвращает пустую строку, если HTTP-запрос не выполнялся или персонаж не подключён.

Pascal

function HTTP_Header: String;

Python

def HTTP_Header() -> str: ...

Pascal Example

begin
  HTTP_Get('https://httpbin.org/get');
  AddToSystemJournal('Response body: ' + HTTP_Header);
  AddToSystemJournal('Response headers: ' + HTTP_Body);
end.

Python Example

HTTP_Get('https://httpbin.org/get')
AddToSystemJournal(f'Response body: {HTTP_Header()}')
AddToSystemJournal(f'Response headers: {HTTP_Body()}')

See Also

HTTP_Get, HTTP_Post, HTTP_Body