Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to solve Curl error: HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1) #486

Open
ThuretGbenougan opened this issue Sep 5, 2022 · 1 comment

Comments

@ThuretGbenougan
Copy link

Curl error: HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)

Short Description:

  • when i try to execute this $ticker = $api->prices(), i have Curl error: HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1). i use laravel v8

Platform:

  • windows

php version:

  • 8.1.3

code in my controller

use Binance\API;

$api = new \API("<api key>","<secret>");
$ticker = $api->prices();
print_r($ticker); // List prices of all symbols

result

Curl error: HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)

thank you

@dmzoneill
Copy link
Collaborator

dmzoneill commented Sep 5, 2022

Hi,

Can you please provide the extract stack tracce error.
It should look something along the lines of

[09-Jul-2013 18:26:16 UTC] PHP Fatal error:  Uncaught exception 'Exception' with message 'The requested file does not exists.' in C:\sites\wonderfulproject\script.php:40
Stack trace:
#0 {main}
  thrown in C:\sites\wonderfulproject\script.php on line 40

you can also downgrade to http1.1 by using
curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);

curl protocol error usually is a system problem and not related to the application itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants