Problem with CORS on Digital Ocean API

January 31, 2019 310 views
API

Hi! I’m trying to send a POST from my Angular app to the Digital Ocean API, using the following endpoint:

https://cloud.digitalocean.com/v1/oauth/token?client_id=MY_CLIENT_ID&client_secret=MY_CLIENT_SECRET&code=MY_CODE’&grant_type=authorization_code&redirect_uri=MY_APP_URL

On Chrome delevoper tools I can see an OPTIONS request is sent first, and returned with 404, so the POST is never sent.
When I try the same endpoint on https://apitester.com/, I get the response successfully.

Any idea? Thanks!

Be the first one to answer this question.