CORS exception on API post requests

Trying to follow the example here: https://circleci.com/docs/api/#trigger-a-new-job
and trigger a new job via a post request, through a small internal browser based app.

Here’s how I’m calling it:

The url is just like circleci.com/api/v1.1/project/:vcs-type/:username/:project?circle-token=:token, with a build_param: { CIRCLE_ JOB: ‘rollback’}`

Here’s the error in the browser:

Access to XMLHttpRequest at ‘url’ from origin ‘http://localhost:8081’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

If I do this via postman, it works fine.

This runs directly in the browser

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.