Nodejs - HTTP call return "UNSUPPORTED_MEDIA_TYPE" error.

Tryall_
Contributor
Contributor

Hi everyone. 

 

I'm trying to integrate Paypal inside my Node.JS application. 

I've already made a successful API call for the Oauth2 token, but when I'm trying to call something else (for example '/v1/billing/subscriptions/'). The paypal API return an error saying : 

 

name : "UNSUPPORTED_MEDIA_TYPE"

message : "The server does not support the request payload's media type".

 

I'm guessing this have to do with the "Content-Type" and "Accept" variable from the HTTP header. Even by following the Paypal API documentation (https://developer.paypal.com/docs/api/reference/api-requests/#http-request-headers), or Even if I try "application/json", "application/x-www-form-urlencoded' and also tried to stringified my Body data. Nothing work.

Does someone can share their working http header, to see if i'm doing anything wrong ?

 

Thank you very much for your help.

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.