execute() public method

Executes curl request.
public execute ( string $url, string $postString = '', array $headers = [] ) : string
$url string
$postString string
$headers array
return string
Example #1
0
 /**
  * Executes request to Pinterest API.
  *
  * @param string $resourceUrl
  * @param string $postString
  *
  * @return string
  */
 public function exec($resourceUrl, $postString = '')
 {
     $url = UrlBuilder::buildApiUrl($resourceUrl);
     $headers = $this->getHttpHeaders();
     $postString = $this->filePathToUpload ? $this->postFileData : $postString;
     $result = $this->httpClient->execute($url, $postString, $headers);
     $this->filePathToUpload = null;
     return $result;
 }