HomePhabricator

mediawiki.api: Use FormData for POST requests when supported

Authored by Juliusz Gonera <jgonera@wikimedia.org>.

Description

mediawiki.api: Use FormData for POST requests when supported

Prefer using FormData for POST requests with contentType set to
'multipart/form-data'. POST requests tend to contain large
strings, which inflate with escaping. FormData keeps that small
through literals with boundaries instead of heavy escaping.

Also, FormData is needed for file uploads via AJAX.

Change-Id: Ibb652e4740aca0a710c0ad426796d98217753842

Details