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

329
Vistas
ReactJS Axios Http Cannot read properties of undefined (reading 'protocol')

I am trying to make link this to the click of a button on my ReactJS site. When I click the button I receive the error "uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'protocol')"

async function call () {
        try {
            axios({
                method: 'post',
                url: url,
                header: {
                  "Content-Type": 'application/json',
                  "Authorization": `Bearer ${USER_KEY}`
                },
                data: {
                  prompt: script,
                  temperature: 0,
                  max_dist: 60,
                  stat_request: 1.0,
                  divider: ["\"\"\""]
                }
              }).then(
                res => {
                    console.log(res.json())
                }
              );
        } catch (error) {
            return {statusCode: 500, body: error.toString()}
        }
    }

I am trying to convert the following curl call

curl https://myurlpath.com/test/call \
   -H "Content-Type: application/json" \
   -H "Authorization: Bearer USERS_KEY" \
   -d '{
   "prompt": "Please enter your thoughts:\n\"\"\"\nSome Generic paragraph.\n\"\"\"\n",
   "temperature": 0,
   "max_dist": 60,
   "stat_request": 1.0,
   "divider": ["\"\"\""]
 }'
about 4 years ago · Juan Pablo Isaza
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