Trying To Get A Specific User Using Axios Get Request Not Working. Should Be A Minor Fix?
I figured it would work similarly to my delete request since it targets a specific user(delete request works perfect), so I passed an id as well to my get request. I logged the res
Solution 1:
GET
requests don't have bodies. At least, in theory any HTTP request can, but you're looking for your value in the wrong place. Typically one would send the ID in the URL, so for a route matching:
/users/display/:id
you'd send:
/users/display/12345
using, I imagine, something like:
axios.get(`http://localhost:8000/users/display/${id}`)
On the server side, you'd receive your ID as req.params.id
. OF course, I've made the assumption you're using Express, but you do seem to be!
Post a Comment for "Trying To Get A Specific User Using Axios Get Request Not Working. Should Be A Minor Fix?"