HTTP API: All non-GET/HEAD requests should put the arguments in the form body.

Requests defaults to _GET/query for HEAD/GET/DELETE and _POST/body for POST/PUT/OPTIONS/PATCH. For backward compatibility `WP_HTTP` needs to force `data_format` to 'body' for all non-GET/HEAD requests.

Props dd32.
Fixes #37456.

git-svn-id: https://develop.svn.wordpress.org/trunk@38165 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling 2016-07-27 15:51:19 +00:00
parent 24f890045c
commit 2db9d7bee7

View File

@ -315,8 +315,7 @@ class WP_Http {
}
if ( empty( $r['redirection'] ) ) {
$options['follow_redirects'] = false;
}
else {
} else {
$options['redirects'] = $r['redirection'];
}
@ -333,11 +332,15 @@ class WP_Http {
// SSL certificate handling
if ( ! $r['sslverify'] ) {
$options['verify'] = false;
}
else {
} else {
$options['verify'] = $r['sslcertificates'];
}
// All non-GET/HEAD requests should put the arguments in the form body.
if ( 'HEAD' !== $type && 'GET' !== $type ) {
$options['data_format'] = 'body';
}
/**
* Filters whether SSL should be verified for non-local requests.
*