API:Import/ru

POST-запрос для импорта страницы из другой Вики (transwikiing) или из xml-файла.

Примеры
Импорт страниц является многоэтапным процессом:  Войдите, используя один из методов, описанных в . Получите. Этот токен един для всех страниц, но изменяется при каждом входе в систему.

 Отправьте POST-запрос с токеном CSRF, чтобы импортировать страницу. 

Примеры кода ниже подробно описывают третий шаг.

Пример кода
import_interwiki.py

Пример кода
For simplicity, the following code is reading the XML from a textarea and makes use of MediaWiki's JavaScript includes.

This is just a minimal implementation. Do not forget error-handling. If you have the exports as files for upload and want to make it working in older browsers not sufficiently supporting Blobs and FormData, just build a HTML form. The form's target could be an iframe so you can read the response from it without exposing the blank API result page to your users.

Ruby source code example using httpclient (assumes login cookies are already in @headers).

Возможные ошибки
In addition to :

История параметров

 * v1.29: Введены
 * v1.20: Introduced

Дополнительная информация

 * This module cannot be used as a.
 * rights are required in order to upload an xml file, while  rights are required for interwiki imports.
 * If you get a  error, it is because you sent it url-encoded but claimed it would be multipart/form-data. MediaWiki is looking for a boundary in the header but cannot find it.
 * Parameters marked with  are only used when importing an uploaded XML file. Similarly, parameters marked with   are only used when importing from another wiki (transwiki).
 * The possible values for the  parameter differ per wiki, see . If the list of possible values for this parameter is empty, interwiki imports are disabled.

См. также

 * Special:Export - Export the text and editing history of a particular page or set of pages wrapped in some XML.
 * through the API.
 * - Upload a file.