aaronsky / appstoreconnect

Unofficial REST API client for Apple's App Store Connect API
MIT License
25 stars 15 forks source link

"HTTP 204 NoContent" success response is wrongly handled as error #4

Open jiri-nohavec opened 5 years ago

jiri-nohavec commented 5 years ago

https://developer.apple.com/documentation/appstoreconnectapi/add_builds_to_a_beta_group appStoreConnect.testflight.addBuildsToBetaGroup(...)

This API method returns "HTTP 204 NoContent" upon success with empty response body. Current API does not expect it and tries to do JSON.parse() on empty body (empty string), which fails. https://github.com/aaronsky/appstoreconnect/blob/master/lib/api/index.ts#L107

body = ""
JSON.parse(body) -> "Uncaught SyntaxError: Unexpected end of JSON input"

I have verified that call itself succeeded, because in the AppStoreConnect web I see beta group assigned to the right build.

xwartz commented 4 years ago

+1 @aaronsky