add http:set_headers function
This commit is contained in:
@@ -120,7 +120,8 @@ Sorting options:
|
|||||||
* `http:get(url, [id])` - executes an HTTP GET request, id - the request identifier string (see below);
|
* `http:get(url, [id])` - executes an HTTP GET request, id - the request identifier string (see below);
|
||||||
* `http:post(url, body, media_type, [id])` - executes an HTTP POST request;
|
* `http:post(url, body, media_type, [id])` - executes an HTTP POST request;
|
||||||
* `http:put(url, body, media_type, [id])` - executes an HTTP request;
|
* `http:put(url, body, media_type, [id])` - executes an HTTP request;
|
||||||
* `http:delete(url, [id])` - executes an HTTP DELETE request.
|
* `http:delete(url, [id])` - executes an HTTP DELETE request;
|
||||||
|
* `http:set_headers(table) - sets the headers for **all** subsequent network requests; the argument is a table with strings like "Cache-Control: no-cache".
|
||||||
|
|
||||||
These functions do not return any value, but instead call the `on_network_result(string, [code])` callback. The first argument is the body of the response, the second (optional) is the code (200, 404, etc.).
|
These functions do not return any value, but instead call the `on_network_result(string, [code])` callback. The first argument is the body of the response, the second (optional) is the code (200, 404, etc.).
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,8 @@ ui:show_context_menu({
|
|||||||
* `http:get(url, [id])` - выполняет запрос HTTP GET, id - строка-идентификатор запрос (см. ниже);
|
* `http:get(url, [id])` - выполняет запрос HTTP GET, id - строка-идентификатор запрос (см. ниже);
|
||||||
* `http:post(url, body, media_type, [id])` - выполняет запрос HTTP POST;
|
* `http:post(url, body, media_type, [id])` - выполняет запрос HTTP POST;
|
||||||
* `http:put(url, body, media_type, [id])` - выполняет запрос HTTP;
|
* `http:put(url, body, media_type, [id])` - выполняет запрос HTTP;
|
||||||
* `http:delete(url, [id])` - выполняет запрос HTTP DELETE.
|
* `http:delete(url, [id])` - выполняет запрос HTTP DELETE;
|
||||||
|
* `http:set_headers(table)` - устанавливает заголовки для **всех** последующих сетевых запросов; аргумент - таблица со строками типа "Cache-Control: no-cache".
|
||||||
|
|
||||||
Эти функции не возвращают никакого значения, а вместо этого вызывают колбек `on_network_result(string, [code])`. Первый аргумент: тело ответа, второй (опциональный) - код (200, 404 и т.д.).
|
Эти функции не возвращают никакого значения, а вместо этого вызывают колбек `on_network_result(string, [code])`. Первый аргумент: тело ответа, второй (опциональный) - код (200, 404 и т.д.).
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user