Skip to content

Commit

Permalink
add url error_message
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouaini528 committed May 19, 2021
1 parent af43008 commit 224c780
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,6 @@ protected function options(){

$this->options['headers']=$this->headers;
$this->options['timeout'] = $this->options['timeout'] ?? 60;

if(isset($this->options['proxy']) && $this->options['proxy']===true) {
$this->options['proxy']=[
'http' => 'http://127.0.0.1:12333',
'https' => 'http://127.0.0.1:12333',
'no' => ['.cn']
];
}
}

/**
Expand Down Expand Up @@ -131,8 +123,11 @@ protected function exec(){

$temp=json_decode($contents,true);
if(!empty($temp)) {
$query='';
if(!empty($this->data)) $query=http_build_query($this->data,'', '&');

$temp['_method']=$this->type;
$temp['_url']=$this->host.$this->path;
$temp['_url']=$this->host.$this->path.$query;
}else{
$temp['_message']=$e->getMessage();
}
Expand Down

0 comments on commit 224c780

Please sign in to comment.