POST requests via XMLHttpRequest fails

Hi all!

I’ve got an issue related to API v2.0.

I’m trying to send XMLHttpRequest (using axios) to API from browser.

GET requests with query parameters works fine.


const CIRCLE_TOKEN: string = ‘***’;
const API_URL: string = ‘’;
const PROJECT_SLUG: string = '/gh/###/###;

        const fetchPipeline = async () => {
            const result = await axios({
                url: `${API_URL}/project${PROJECT_SLUG}/pipeline?circle-token=${CIRCLE_TOKEN}`,
                method: 'GET',


But for POST every request failed due to CORS policy

        const postPipeline = async () => {
            const result = await axios({
                url: `${API_URL}/project${PROJECT_SLUG}/pipeline`,
                method: 'POST',
                headers: {
                    'Access-Control-Allow-Origin': '*',
                    'Content-Type': 'application/json',
                    authorization: `Basic ${CIRCLE_TOKEN}`


The error is following

Access to XMLHttpRequest at ‘***’ from origin ‘localhost:3000’ 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.

Could anyone help, is something wrong with request config?