Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Tak-Pesar authored Aug 10, 2024
1 parent 48f192b commit 40b74f3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Requests.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ public function request(string $method,string $path,array $datas = array(),array
case 'POST':
curl_setopt($this->curl,CURLOPT_URL,(filter_var($path,FILTER_VALIDATE_URL) ? $path : $this->url.'/'.$path));
curl_setopt($this->curl,CURLOPT_POSTFIELDS,json_encode($datas));
break;
break;
case 'GET':
curl_setopt($this->curl,CURLOPT_URL,(filter_var($path,FILTER_VALIDATE_URL) ? $path : $this->url.'/'.$path.'?'.http_build_query($datas)));
curl_setopt($this->curl,CURLOPT_CUSTOMREQUEST,$method);
break;
break;
default:
error_log('The request method is inappropriate for the URL !');
break;
break;
}
curl_setopt($this->curl,CURLOPT_CUSTOMREQUEST,$method);
curl_setopt($this->curl,CURLOPT_HTTPHEADER,$headers);
$result = curl_exec($this->curl);
$error = curl_error($this->curl);
Expand Down

0 comments on commit 40b74f3

Please sign in to comment.