Monday, 24 April 2017

NodeJS request for download iOS Development provisioning profile get wrong response

I know there is a ruby library for apple dev center. It is spaceship. But I want to build a nodejs library so I can use the Apple's API in my server.

I use Charles to capture the HTTPS network package. After analysing the package, I know the host of Apple Dev Center is: https://developer.apple.com, the request URL for downloading a provisioning profile is https://developer.apple.com/services-account/QH65B2/account/ios/profile/downloadProfileContent?teamId&provisioningProfileId. I use the request module to send a HTTPS GET request.

And It is successful, but has some unrecognized response data (wrong):

enter image description here

However, when I output the response.body to a file and double click it. A alert shows "Couldn't load provisioning profile from data."

I think it's something wrong about the encoding or charset.

The response for Charles is correct, and after saving the response, I get a right pp file (right).

enter image description here

Someone has idea? Thanks! I have trouble with it for a while.



via seguedestination

No comments:

Post a Comment