コード例 #1
0
ファイル: Twitter.php プロジェクト: drmovi/Social
 protected function request($method, $path, $getParameters = [], $postParameters = [], $files = [])
 {
     $request = new ResourceRequest($method, $this->getApiUrl($path, $getParameters), $this->config->getAppID(), $this->config->getAppSecret(), $this->config->getAccessTokenKey(), $this->config->getAccessTokenSecret(), SignatureMethods::SIGNATURE_HMAC_SHA1);
     foreach ($postParameters as $key => $value) {
         $request->setPostParameter($key, $value);
     }
     foreach ($files as $name => $file) {
         $request->addFile($name, $file);
     }
     $transporter = $this->getTransporter($request);
     $transporter->send();
     $this->response = $transporter->getResponse();
     $this->responseData = json_decode($this->response->getBody());
 }
コード例 #2
0
ファイル: WorkFlow.php プロジェクト: drmovi/protocol
 /**
  * @param $method
  * @param $url
  * @param array $postParameter
  * @return \Protocol\HTTP\Response
  */
 public function requestResource($method, $url, $postParameter = [])
 {
     $request = new ResourceRequest($method, $url, $this->consumerKey, $this->consumerSecret, $this->accessTokenKey, $this->accessTokenSecret, $this->signatureMethod);
     foreach ($postParameter as $key => $value) {
         $request->setPostParameter($key, $value);
     }
     $transporter = $this->getTransporter($request);
     $transporter->send();
     return $transporter->getResponse();
 }