0

I am trying to call an API endpoint using axios but axios adds some strings on the end of the request url.

I have an endpoint which is

https://api.com/api/Inbound/RemoveCartItem

But what happens is that the request URL is transformed into this mess when the function is called

https://api.com/api/Outbound/RemoveCartItem%E2%80%8B

I have been trying to figure this out what is causing the weird strings to appear on the end part of the request URL.

Here is my function calling the URL

const removeInboundCartItem = async function(item) {
  try {
    const response = await axios.post(
      `https://api.com/api/Inbound/RemoveCartItem`,
      mapper.mapStocklistToCart(item)
    );
    return response;
  } catch (err) {
    console.error(err);
    return [];
  }
};
Nate
  • 403
  • 5
  • 18
  • Look at this post: https://stackoverflow.com/questions/10342012/wordpress-putting-e2808e-at-the-end-of-my-url-howcome – Vasile Radeanu Aug 13 '21 at 08:46
  • Checking on it @Radeanu. But it doesn't seem to work with me at the moment. I am going through all of the suggested solution at the moment – Nate Aug 13 '21 at 08:57
  • None of the suggested solutions there have worked with me @Radeanu. I still have the same issue – Nate Aug 13 '21 at 09:00

0 Answers0