1

I am making a request to a custom endpoint...

VideoAPI.get('/api/getVideo/:id', function(req, res){
  console.log('FROM URL STRING', req.params)
  console.log('FROM PARAMS OBJECT', req.query)
  res.end()
}

If if make an Axios post like so, it never hits the endpoint and I get a 300 status response client side:

axios.get(`/api/getVideo/2`)
  .then( res => {
   console.log(res)
  })

But if I make the call like so, it hits the endpoint as expected, even if the params object is completely irrelevant data:

 axios.get(`/api/getVideo/2`, {
   params : {
    bogus: 'WTF'
   }
 })
.then( res => {
  console.log(res)
})

My console will read:

FROM URL STRING { id: '2' }
FROM PARAMS OBJECT { bogus: 'WTF' }

What am I not understanding here?

0

Your Answer

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

Browse other questions tagged or ask your own question.