Differential D19944 Diff 47609 src/applications/conduit/controller/PhabricatorConduitAPIController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/controller/PhabricatorConduitAPIController.php
Show First 20 Lines • Show All 599 Lines • ▼ Show 20 Lines | private function renderAPIValue($value) { | ||||
return $value; | return $value; | ||||
} | } | ||||
private function decodeConduitParams( | private function decodeConduitParams( | ||||
AphrontRequest $request, | AphrontRequest $request, | ||||
$method) { | $method) { | ||||
$content_type = $request->getHTTPHeader('Content-Type'); | |||||
if ($content_type == 'application/json') { | |||||
throw new Exception( | |||||
pht('Use form-encoded data to submit parameters to Conduit endpoints. '. | |||||
'Sending a JSON-encoded body and setting \'Content-Type\': '. | |||||
'\'application/json\' is not currently supported.')); | |||||
} | |||||
// Look for parameters from the Conduit API Console, which are encoded | // Look for parameters from the Conduit API Console, which are encoded | ||||
// as HTTP POST parameters in an array, e.g.: | // as HTTP POST parameters in an array, e.g.: | ||||
// | // | ||||
// params[name]=value¶ms[name2]=value2 | // params[name]=value¶ms[name2]=value2 | ||||
// | // | ||||
// The fields are individually JSON encoded, since we require users to | // The fields are individually JSON encoded, since we require users to | ||||
// enter JSON so that we avoid type ambiguity. | // enter JSON so that we avoid type ambiguity. | ||||
▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines |