Hi,
I am trying to send a push notification via PHP-curl and command-line curl for http2 but after trying possible methods I end up getting the same error response "curl: (55) Failed sending HTTP POST request"
Curl
Output:
What is wrong with my CURL request?
Any hit would be helpful, thanks.
I am trying to send a push notification via PHP-curl and command-line curl for http2 but after trying possible methods I end up getting the same error response "curl: (55) Failed sending HTTP POST request"
Curl
Code Block curl -v -d '{"aps":{"alert":"Hello"},"yourCustomKey":"11"}' \ -H "Content-Type: application/json" -X POST \ --http2 https://api.development.push.apple.com/3/device/DEVICE_TOKEN \ -H ':method: POST' \ -H ':scheme: https' \ -H ':path: /3/device/DEVICE_TOKEN' \ -H 'authorization: bearer TOKEN' \ -H 'apns-id: b150795-35ea-4894-a289-85e343936cca' \ -H 'apns-push-type: alert' \ -H 'apns-expiration: 1609919807' \ -H 'apns-priority: 10' \ -H 'apns-topic: com.company.suffix' \ -H 'apns-collapse-id: 9cb3190c-6046-4b7c-8cf4-61c6d05fd724'
Output:
Code Block * Trying 17.188.138.73:443... * Connected to api.development.push.apple.com (17.188.138.73) port 443 (#0) * ALPN, offering h2 * ALPN, offering http/1.1 * successfully set certificate verify locations: * CAfile: /etc/ssl/certs/ca-certificates.crt CApath: none * TLSv1.3 (OUT), TLS handshake, Client hello (1): * TLSv1.3 (IN), TLS handshake, Server hello (2): * TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8): * TLSv1.3 (IN), TLS handshake, Request CERT (13): * TLSv1.3 (IN), TLS handshake, Certificate (11): * TLSv1.3 (IN), TLS handshake, CERT verify (15): * TLSv1.3 (IN), TLS handshake, Finished (20): * TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1): * TLSv1.3 (OUT), TLS handshake, Certificate (11): * TLSv1.3 (OUT), TLS handshake, Finished (20): * SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 * ALPN, server accepted to use h2 * Server certificate: * subject: CN=api.development.push.apple.com; OU=management:idms.group.533599; O=Apple Inc.; ST=California; C=US * start date: Apr 17 17:37:51 2019 GMT * expire date: May 16 17:37:51 2021 GMT * subjectAltName: host "api.development.push.apple.com" matched cert's "api.development.push.apple.com" * issuer: CN=Apple IST CA 2 - G1; OU=Certification Authority; O=Apple Inc.; C=US * SSL certificate verify ok. * Using HTTP2, server supports multi-use * Connection state changed (HTTP/2 confirmed) * Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0 * Failed sending HTTP POST request * Connection #0 to host api.development.push.apple.com left intact curl: (55) Failed sending HTTP POST request
What is wrong with my CURL request?
Any hit would be helpful, thanks.