Expose HTTP PUT when supported, props mdawaffe, fixes #10855
git-svn-id: https://develop.svn.wordpress.org/trunk@11977 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
1ef0620a33
commit
343e591c2b
@ -1121,6 +1121,9 @@ class WP_Http_ExtHTTP {
|
|||||||
case 'HEAD':
|
case 'HEAD':
|
||||||
$r['method'] = HTTP_METH_HEAD;
|
$r['method'] = HTTP_METH_HEAD;
|
||||||
break;
|
break;
|
||||||
|
case 'PUT':
|
||||||
|
$r['method'] = HTTP_METH_PUT;
|
||||||
|
break;
|
||||||
case 'GET':
|
case 'GET':
|
||||||
default:
|
default:
|
||||||
$r['method'] = HTTP_METH_GET;
|
$r['method'] = HTTP_METH_GET;
|
||||||
@ -1306,6 +1309,10 @@ class WP_Http_Curl {
|
|||||||
curl_setopt( $handle, CURLOPT_POST, true );
|
curl_setopt( $handle, CURLOPT_POST, true );
|
||||||
curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] );
|
curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] );
|
||||||
break;
|
break;
|
||||||
|
case 'PUT':
|
||||||
|
curl_setopt( $handle, CURLOPT_CUSTOMREQUEST, 'PUT' );
|
||||||
|
curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( true === $r['blocking'] )
|
if ( true === $r['blocking'] )
|
||||||
|
Loading…
Reference in New Issue
Block a user