2

Axios is not sending my cookies in my post requests even with “withCredentials: true”. Always get an error saying cookie “xxx” is missing. even tried "axios.defaults.withCredentials = true" Also it seems the http cookies are the ones that wont send.

axios.post('https://www.walmart.com/api/checkout/v3/contract?page=CHECKOUT_VIEW', 
{
    'affiliateInfo:com.wm.reflector': com,
    'city': "example",
    'crt:CRT': "", //this is a cookie that won't send
    'customerId:CID': "",//this is a cookie that won't send
    'customerType:type': "",//this is a cookie that won't send
    'isZipLocated': true,
    'postalCode': "example",
    'state': "example",
},
     {   headers: {
        "accept": "application/json, text/javascript, */*; q=0.01",
        "accept-encoding": "gzip, deflate, br",
        "accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7",
        "content-type": "application/json",
        "origin": "https://www.walmart.com",
        "referer": "https://www.walmart.com/checkout/",
        "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.69 Safari/537.36",
        'inkiru_precedence': false,
        "wm_vertical_id": "0",
        "upgrade-insecure-requests": "1"
        },
})
.then(response => { 
    console.log(response)
})
.catch(error => {
    console.log(error.response)
});
1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.