小编Phi*_*ast的帖子

CURL HTTP2请求

我想知道是否有人成功设法使用CURL通过新的APNS API(HTTP2)发送推送通知.

APNs Provider API页面上给出的示例请求

这是请求必须如何:

HEADERS

\- END_STREAM

\+ END_HEADERS

:method = POST

:scheme = https

:path = /3/device/00fc13adff785122b4ad28809a3420982341241421348097878e577c991de8f0

host = api.development.push.apple.com

apns-id = eabeae54-14a8-11e5-b60b-1697f925ec7b

apns-expiration = 0

apns-priority = 10

content-length = 33
Run Code Online (Sandbox Code Playgroud)

数据

\+ END_STREAM

{ "aps" : { "alert" : "Hello" } }
Run Code Online (Sandbox Code Playgroud)

但是使用以下命令我得到错误"curl:(16)HTTP/2流1没有干净地关闭:error_code = 8":

curl \

--verbose \

--http2 \

--cert <APPLICATION_CERT_FILE> \

--key <APPLICATION_KEY_FILE> \

--header "Content-Type: application/json" \

--header ":method: POST" \

--header ":path: /3/device/<DEVICE ID>" \

--data '{ "aps" …
Run Code Online (Sandbox Code Playgroud)

curl

10
推荐指数
3
解决办法
2万
查看次数

标签 统计

curl ×1