Khandaker Toihidul Islam
Front-end Developer
React Js | Javascript | HTML | CSS | Bootstrap | Wordpress | PHP | Mysql

Axios sent OPTIONS request instead of POST method

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;

You may also like...

Leave a Reply