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

223
Vistas
Get 401 when using ajax call to retrieve data from couchdb

I try to use ajax call in js file to retrieve data from couchdb.

But I got the 401 error: Failed to load resource: the server responded with a status of 401 (Unauthorized)

Here is my js code:

var locate_data = $.ajax({
  url: 'http://admin:mypassword@localhost:5984/database_name',
  type:'GET',
  dataType: "json",
  success: function(data){
    console.log("successfully loaded."), 
    alert(data);
  },
  error: function(xhr) {
       console.log("error"), 
       alert(xhr.statusText)
   }
})

I can use 'curl GET' to get the data from couchdb by using the terminal.

What is the problem? and how can I fix it?

over 4 years ago · Santiago Trujillo
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