Vapor: FoundationClient not working in Linux

Created on 30 Mar 2018  路  3Comments  路  Source: vapor/vapor

Steps to reproduce

    let httpClient = try FoundationClient.makeService(for:app)

    let url = "https://api.development.push.apple.com/3/device/454654654654"

    let response = httpClient.post(url)

    response.do { response in
        debugPrint(response)
        }.catch { error in
            debugPrint(error)
    }

RESPONSE in macOS

HTTP/1.1 403
apns-id: 96158C63-8064-D88B-C475-F2E32247F55D
content-length: 33
{"reason":"MissingProviderToken"}

RESPONSE in Ubuntu 16.04

HTTP/1.1 200
content-length: 107

enhancement

Most helpful comment

We _were_ planning on HTTP/2 with 3.0.0 release, but that was before NIO. NIO's HTTP/2 support will be coming very soon though!

All 3 comments

Apple's APNS requires HTTP/2 for this protocol to work. @Andrewangeta mentioned to me that Vapor 3 was supposed to be getting a native HTTP/2 client, so if thats the case, this will make this all function correctly, otherwise you still have to install cURL with HTTP/2 support

We _were_ planning on HTTP/2 with 3.0.0 release, but that was before NIO. NIO's HTTP/2 support will be coming very soon though!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

olivier38070 picture olivier38070  路  3Comments

xiaoyifan picture xiaoyifan  路  3Comments

nhatlee picture nhatlee  路  3Comments

0xTim picture 0xTim  路  4Comments

OlegKorchickiy picture OlegKorchickiy  路  3Comments