Differential D12680 Diff 30510 src/infrastructure/daemon/bot/adapter/PhabricatorBotBaseStreamingProtocolAdapter.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/daemon/bot/adapter/PhabricatorBotBaseStreamingProtocolAdapter.php
Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | list($output) = id(new HTTPSFuture($uri)) | ||||
->setMethod('POST') | ->setMethod('POST') | ||||
->addHeader('Content-Type', 'application/json') | ->addHeader('Content-Type', 'application/json') | ||||
->addHeader('Authorization', $this->getAuthorizationHeader()) | ->addHeader('Authorization', $this->getAuthorizationHeader()) | ||||
->setData($payload) | ->setData($payload) | ||||
->resolvex(); | ->resolvex(); | ||||
$output = trim($output); | $output = trim($output); | ||||
if (strlen($output)) { | if (strlen($output)) { | ||||
return json_decode($output, true); | return phutil_json_decode($output); | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
protected function getAuthorizationHeader() { | protected function getAuthorizationHeader() { | ||||
return 'Basic '.$this->getEncodedAuthToken(); | return 'Basic '.$this->getEncodedAuthToken(); | ||||
} | } | ||||
Show All 10 Lines |