Using MediaWiki facility for HTTP post

Change-Id: If800c4ecbcbecc8560bfd3e704e03acac2ac71d9
This commit is contained in:
Trevor Parscal 2012-06-08 16:00:53 -07:00
parent a2231cb6ca
commit 60fc5a3c58

View file

@ -27,12 +27,7 @@ class ApiVisualEditor extends ApiBase {
} elseif ($params['paction'] === 'save') {
// API Posts HTML to Parsoid Service, receives Wikitext,
// API Saves Wikitext to page.
$c = curl_init( $parsoid.$page );
curl_setopt($c, CURLOPT_POST, 1);
curl_setopt($c, CURLOPT_POSTFIELDS, 'content='.$params['html']);
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
$wikitext = curl_exec($c);
curl_close($c);
$wikitext = Http::post( $parsoid.$page, array( 'postData' => 'content='.$params['html'] ) );
if ( $wikitext ) {