From 4e7a0c7337e7dc81b97d96653bdf7dcdc4137663 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Fri, 6 Apr 2018 13:58:39 +1000 Subject: [PATCH] Send API requests as a JSON blob, instead of form encoded data. (#5971) Fixes #5867. --- lib/compat.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/compat.php b/lib/compat.php index e0372a72fadabd..c6328b0568644d 100644 --- a/lib/compat.php +++ b/lib/compat.php @@ -121,6 +121,9 @@ function gutenberg_shim_api_request_emulate_http( $scripts ) { } options.headers['X-HTTP-Method-Override'] = options.method; options.method = 'POST'; + + options.contentType = 'application/json'; + options.data = JSON.stringify( options.data ); } }