I try to use Apple Music API and do as the document says, first created the JWT and made the authenticate request as bellow:
curl -v -H 'Authorization: Bearer eyJhbGciOiJFUzI1NiIsImtpZCI6IkNhcEV4ZWRLaWQifQ.eyJpc3MiOiJDYXBFeGRUZWFtIiwiaWF0IjoxNDk3MjMyMjIzLCJleHAiOjE1MDcyMzIyMjN9.MEUCIQDtq896THqLbvJcN2qYzCoiOqDI7Rk_LXlBfnSBp-YBWwIgdyLX4T4LZkWKE4o
(The private key was provided by the doc. )
I try many times, but only got a Http status code 500... the details were below:
* Trying 23.218.1.89...
* TCP_NODELAY set
* Connected to api.music.apple.com (23.218.1.89) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate: api.music.apple.com
* Server certificate: Symantec Class 3 EV SSL CA - G3
* Server certificate: VeriSign Class 3 Public Primary Certification Authority - G5
> GET /v1/catalog/us/songs/203709340 HTTP/1.1
> Host: api.music.apple.com
> User-Agent: curl/7.50.3
> Accept: */
> Authorization: Bearer eyJhbGciOiJFUzI1NiIsImtpZCI6IkNhcEV4ZWRLaWQifQ.eyJpc3MiOiJDYXBFeGRUZWFtIiwiaWF0IjoxNDk3MjMyMjIzLCJleHAiOjE1MDcyMzIyMjN9.MEUCIQDtq896THqLbvJcN2qYzCoiOqDI7Rk_LXlBfnSBp-YBWwIgdyLX4T4LZkWKE4o6KFZJGzW_CyHoyGUX7mbJ6s9JXhI
>
< HTTP/1.1 500 Internal Server Error
< Server: openresty/1.11.2.2
< Content-Type: text/plain; charset=UTF-8
< nnCoection: close
< Date: Mon, 12 Jun 2017 02:16:45 GMT
< Connection: close
<
An unexpected error occurred
* Curl_http_done: called premature == 0
* Closing connection 0
Please somebody help me..