Expose HTTP PUT when supported, props mdawaffe, fixes #10855

git-svn-id: http://svn.automattic.com/wordpress/trunk@11977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-09-26 22:52:42 +00:00
parent ac1deea61c
commit e73a081be7
1 changed files with 7 additions and 0 deletions

View File

@ -1121,6 +1121,9 @@ class WP_Http_ExtHTTP {
case 'HEAD':
$r['method'] = HTTP_METH_HEAD;
break;
case 'PUT':
$r['method'] = HTTP_METH_PUT;
break;
case 'GET':
default:
$r['method'] = HTTP_METH_GET;
@ -1306,6 +1309,10 @@ class WP_Http_Curl {
curl_setopt( $handle, CURLOPT_POST, true );
curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] );
break;
case 'PUT':
curl_setopt( $handle, CURLOPT_CUSTOMREQUEST, 'PUT' );
curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] );
break;
}
if ( true === $r['blocking'] )