/** * @expectedException \Wkop\Exceptions\UrlMissingException */ public function testResetsAfterGetKey() { $signer = new Signer('a', 'b'); $signer->setUrl('http://a.wykop.pl'); $signer->getSigningKey(); $signer->getSigningKey(); }
/** * Post data * * @param $resource * @param array $params * @param array $methodParams * @param array $postData * @return mixed * @throws Exceptions\UrlMissingException */ public function post($resource, $params = [], $methodParams = [], $postData = []) { $url = $this->prepareUrl($resource, $params, $methodParams); $this->signer->setUrl($url)->setPostData($postData); $signingKey = $this->signer->getSigningKey(); $response = $this->httpClient->post($url, ['headers' => ['apisign' => $signingKey], 'body' => $postData]); return $response->json(); }