0
  const loadCustomers = (url) => {
        if(loading === false){
          setLoading(true);
        }
        axios
          .post(url, {
      'pagination[page]': offset,
      'pagination[pages]': '',
      'pagination[perpage]': '10',
      'pagination[total]':'',
      'query[search]':'',
      'search[value]':'',
      'filter':'',
      'from':'',
      'to':'',
      'version':'2'
          },{
    headers:{
    "Cookie":'workid_token=eyJraWQiOiJLdERRenZsb3JTYWptXC90V3Y4NnlQUjhiaFlvTG5sYU9BZEh6S2JRWFR1TT0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIyMWVjZGJlZS01N2QxLTQwOTMtYWIwMy00MzgxZDIzOGM0OTMiLCJnaWQiOiIxMTgzNzM2OTYiLCJtb2JDxvDkQRFNTDDKgwtr4GLHNy_HxqF50UwgRAZ1kxgD6MB7nMdBkMg;base_token=eyJjdHkiOiJKV1QiLCJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiUlNBLU9BRVAifQ.TU_LoRkmA5VXb-sAcbwzwTr_OOONZlWOTycX98yaNiHwcO4fxv375k4-NYbAcZuiJ-TVs-KQgppnQEYK5IAGC3ExBi_do5LXaYKVYRdfcQ1cuL59UWtQpBjxafwvRURoMEpfrLdEpOTZPHTSnlZ9kCUNSj4Dibkr09TXf1feXlDYBTOpq1xpLzJVKQZMUMEEikzdgAUYgOOyWMZ4hwpdzLUTwFGz3wL2tHWVDY2pB2sMICH_g1NBifjmzacMEqZf6LTwvsMsoH-xI7sOOm8g5w.BdP1KsaeRjiRPCzxz4YQhA;PHPSESSID=lvvf6qkn3lh53ginevdjdd2ff0;',
    }
    }     
    ).then(function (response) {
            // handle success
            // alert(JSON.stringify(response.data));
            

          }).catch(function (error) {
            // handle error
            alert(error.message);
          });
      };

I am passing string value in header for api call but it's not accepting the header.If i copy and paste the header value in postman i am getting response.

Issue is the value inside cookie is not accepting the api.please let me know how to pass this value in header.

Vishali
  • 1,307
  • 4
  • 23
  • 41
  • Just set withCredentials: true https://stackoverflow.com/a/64423138/13405106 or https://stackoverflow.com/a/43178070/13405106 – Usama Apr 08 '22 at 10:02
  • after setting withCredentials:true also i am not getting response.still it's saying same error cookie is not sent – Vishali Apr 08 '22 at 10:26

0 Answers0