cURL:HTTP/2流1未完全关闭:协议错误(错误1)

cURL:HTTP/2流1未完全关闭:协议错误(错误1),curl,video,youtube,Curl,Video,Youtube,我正试图通过cURL将视频上传到Youtube的API。这是我的代码: curl -v -X PUT '#{upload_uri}' -H 'Authorization: Bearer #{@test_token}' -H 'Content-Length: #{File.size(@video).to_s}' -H 'Content-Type: video/*' -d @'#{@video}' 我得到的答复是 % Total % Received % Xferd Average S

我正试图通过cURL将视频上传到Youtube的API。这是我的代码:

curl -v -X PUT '#{upload_uri}' -H 'Authorization: Bearer #{@test_token}' -H 'Content-Length: #{File.size(@video).to_s}' -H 'Content-Type: video/*' -d @'#{@video}'
我得到的答复是

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 216.58.196.170...
* TCP_NODELAY set
* Connected to www.googleapis.com (216.58.196.170) port 443 (#0)
---
---
* Using Stream ID: 1 (easy handle 0x7f9570000400)
> PUT /upload/youtube/v3/videos?part=snippet,status,contentDetails&uploadType=resumable&upload_id=<id> HTTP/2
> Host: www.googleapis.com
> User-Agent: curl/7.54.0
> Accept: */*
> Authorization: Bearer <token>
> Content-Length: 140926828
> Content-Type: video/*
> 
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
} [16384 bytes data]
 97 65.3M    0     0   97 64.0M      0  3704k  0:00:18  0:00:17  0:00:01 4226k* We are completely uploaded and fine
< HTTP/2 400 
< content-type: text/html; charset=UTF-8
< referrer-policy: no-referrer
< content-length: 1555
< date: Wed, 04 Mar 2020 09:21:34 GMT
< 
* HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1)
 99 65.3M    0     0  100 65.3M      0  3714k  0:00:18  0:00:18 --:--:-- 4242k
* Closing connection 0
* TLSv1.2 (OUT), TLS alert, Client hello (1):
} [2 bytes data]
curl: (92) HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1)
%Total%接收到%x平均速度时间电流
数据加载上载总左速度
0 0 0 0 0 0 0--:-:-:-:-:-:---:---0*正在尝试216.58.196.170。。。
*TCP_节点集
*已连接到www.googleapis.com(216.58.196.170)端口443(#0)
---
---
*使用流ID:1(易处理0x7F957000400)
>PUT/upload/youtube/v3/videos?part=snippet、status、contentDetails&uploadType=resubable&upload\u id=HTTP/2
>主持人:www.googleapis.com
>用户代理:curl/7.54.0
>接受:*/*
>授权:持票人
>内容长度:140926828
>内容类型:视频/*
> 
*连接状态已更改(最大并发流已更新)!
}[16384字节数据]
97 65.3M 0 0 97 64.0M 0 3704k 0:00:18 0:00:17 0:00:01 4226k*我们已完全上传,一切正常
我知道这与
内容长度的值不正确有关。但是,此标头的值与作为二进制文件发送的文件的大小相匹配

那么,在旋度中,是什么导致了这个错误呢

邮递员可以很好地处理此请求,这里提供的内容长度与邮递员相同