Stream error in the HTTP/2 framing layer

When using R for posting json to a web api I got the error

Error in curl::curl_fetch_memory(url, handle = handle) :
Stream error in the HTTP/2 framing layer

But only after the first successful run. Strange. Something was hanging the handle in the background. Or that was my guess at least.

Anyway, if I set the version back to HTTP/1.1 it works fine.

Here is the gist of it

httr::set_config(config(http_version = 2)) # set the HTTP version to 1.1 (none, 1.0, 1.1, 2)
sendMail <- function(e){
body <- list(secret = 'sfsdf£$4500dfdd__$$', body=e["message"]) # create a list that will be serialized to JSON
result <- POST(url = ""
, body = body , encode = "json", handle = NULL)
myProcess <- function(){
tryCatch(myProcess(), error = sendMail)

view raw


hosted with ❤ by GitHub


One thought on “Stream error in the HTTP/2 framing layer

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s