curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
Fix curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1) using http/1.1
Play this article
I was trying to upload a video file to Google Cloud Storage using Google Storage API using CURL from my Mac Book. I was not getting the response from the API. Instead CURL was throwing a error "curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)"
I found this issue happening because of new version of CURL is using HTTP/2 as default. In older CURL version it was HTTP/1.1
So HTTP/2 will not be compatible with older API services. So a HTTP/2 request to an older API service will be failed to connect. In this case I set the HTTP version to 1.1 when sending the request like shown in the below image and it helped me to fix this.
I hope you found this article helpful.
Thank you for reading!.