Page 1 of 1

rest api used --http2

Posted: Fri Aug 11, 2017 9:16 am
by HAnil
Hello Friends,

I want to program rest api for this case:

curl -d '{"aps":{"alert":"hi","sound":"default"}}' \
--cert <your-certificate.pem>:<certificate-password> \
-H "apns-topic: <your-app-bundle-id>" \
--http2 \
https://api.development.push.apple.com/ ... vice-token>


that is use --http2 parameter. how can I define in "set the httpHeaders to" structure.

I am grateful for your help.
Regards,
Anil

Re: rest api used --http2

Posted: Mon Sep 04, 2017 1:38 am
by Mark
To force LiveCode to use http2, you'd have to change libUrl or tsNet.tsNet might have a parameter that lets you choose http2, since it includes the CURL library. Unfortunately, tsNet isn't open source. You could also write your own request along the lines if

write "GET /index.html HTTP/2.0" & cr to socket "https://api.development.push.apple.com:80"

I haven't tested this. You may need to use the IP address and you'd have to figure out how to open a datagram socket to Apple's server.

Why don't you use the built-in push notification messages?