Skip to content
Advertisement

Tag: axios

View original request response header using axios

When I make my web request in the firefox devtools I get two network responses The two responses However when I make a request using axios. Axios is only printing out the response to the second response, and I need data from the first response with the status of 302, but I only get the 200 status response Answer You

How to listen to external variable changes in React

Hope you’re doing well 🙂 I’ve an “auth.js” file, with an aysnc function to get the userId and then store it in session storage. Here it is: Then I access this variable in all components that need it, in order to make other requests. Example in App.js: The problem is that, in the first render, the userId comes null (obviously)

Not understanding payload in update action

I am having trouble understanding in how will the payload look in the first action. Why in the first one there is { } and … , what does that give? How do I pass data into it, when I call it from a component? In the second one, i would just pass an object, but I don’t get the

My first api request always fails after page load

I’m having a problem with my API request that always fails after page load. Don’t really know where Im wrong. Here’s my request and I call it when I interact with handleOpen function. ERROR: Answer It’s because your Ticker parameter is empty. When you create “stock”, clickedElement.ticker is undefined. Do this: Make getStock like like this:

Advertisement