Axios sent OPTIONS request instead of POST method

Posted by

Axios uses JSON as the default content type, the call was always going with a browser as a OPTIONS call not a POST method. To overcome, we need to set the ‘Content-Type’ correctly. My configuration as following

        let config={
            headers: {'Content-Type' : 'application/x-www-form-urlencoded'}
             return error;

Leave a Reply