我生成了一个通过postman截取的cURL代码。
然后,我想在Ubuntu命令行上尝试使用此代码段。 不幸的是,我得到了标题中提到的错误。
$ curl -X POST https://api.divessi.com/divessi/index.php -H 'Accept: */*' -H 'Accept-Encoding: gzip, deflate' -H 'Cache-Control: no-cache' -H 'Connection: keep-alive' -H 'Content-Length: 567' -H 'Content-Type: multipart/form-data; boundary=--------------------------200585169178436237800635' -H 'Host: api.divessi.com' -H 'Postman-Token: 7a01a87c-9baa-42dc-84da-562cea5b48f9,88e83a92-08fc-4247-97ef-21b13616e420' -H 'User-Agent: PostmanRuntime/7.19.0' -H 'cache-control: no-cache' -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' -F 'apiauth=xxx' -F dc=xxxx -F auth=xxxx -F 'json-data={ "getJSON" : { "stream" : "mystream"}
}'
curl: (92) HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1)
这是我安装的版本:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic
$ curl --version
curl 7.58.0 (x86_64-pc-linux-gnu) libcurl/7.58.0 OpenSSL/1.1.1 zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Release-Date: 2018-01-24
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL