Update curl_setopt()

This commit is contained in:
Visman 2023-05-14 21:47:47 +07:00
parent 947705cc3c
commit cdbcfa8d09
2 changed files with 6 additions and 1 deletions
app/Models/Provider

View file

@ -158,6 +158,8 @@ abstract class Driver extends Model
return false;
}
\curl_setopt($ch, \CURLOPT_MAXREDIRS, 10);
\curl_setopt($ch, \CURLOPT_TIMEOUT, 10);
\curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Accept: application/json']);
\curl_setopt($ch, \CURLOPT_POST, true);
\curl_setopt($ch, \CURLOPT_POSTFIELDS, \http_build_query($params));

View file

@ -43,8 +43,11 @@ class GitHub extends Driver
return false;
}
\curl_setopt($ch, \CURLOPT_MAXREDIRS, 10);
\curl_setopt($ch, \CURLOPT_TIMEOUT, 10);
\curl_setopt($ch, \CURLOPT_HTTPHEADER, $headers);
\curl_setopt($ch, \CURLOPT_POST, false);
\curl_setopt($ch, \CURLOPT_HTTPGET, true);
// \curl_setopt($ch, \CURLOPT_POST, false);
\curl_setopt($ch, \CURLOPT_RETURNTRANSFER, true);
\curl_setopt($ch, \CURLOPT_HEADER, false);