Skip to content

Commit

Permalink
request type get bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouaini528 committed Mar 9, 2021
1 parent a2e43d6 commit 9ce9f37
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ protected function nonce(){
* 签名
* */
protected function signature(){
if(empty($this->key)) return;

$param = [
'AccessKeyId' => $this->key,
'SignatureMethod' => 'HmacSHA256',
Expand Down Expand Up @@ -143,6 +145,10 @@ protected function send(){
$this->options['body']=json_encode($this->data);
}

if($this->type=='GET' && empty($this->key)){
$this->signature = empty($this->data) ? '' : http_build_query($this->data);
}

$response = $client->request($this->type, $this->host.$this->path.'?'.$this->signature, $this->options);

return $response->getBody()->getContents();
Expand Down

0 comments on commit 9ce9f37

Please sign in to comment.