Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

326
Vistas
Uncaught (in promise) Error:createError.js:16 Uncaught (in promise) Error: Request failed with status code 404

I am trying to make simple API Fetch with axios through a simple form,input, and everything works fine untill I pass user into my axio get.'

first error: GET https://api.github.com/users/$%7Buser%7D 404 second error: createError.js:16 Uncaught (in promise) Error: Request failed with status code 404 '''

  function App() {

  let getUser = (e) =>{
  e.preventDefault()
  const user = e.target.elements.username.value  

  axios.get("https://api.github.com/users/${user}")
  .then((res) => {
  console.log(res)
  })

  }

 return (

<div className="App">
  <header className="App-header">
    <h1 className="App-title">HTTP&API</h1>
  </header>
    <UserForm getUser={getUser}/>
</div>
  );
 }

'''

I am new to a web dev, any help would be appreciated.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

either concatenate the string

axios.get("https://api.github.com/users/" + user)

or use template strings

axios.get(`https://api.github.com/users/${user}`)
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda