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

332
Vistas
How to resolve 431 error - return base 64 from nitro server to frontend

I'm currently working on a project to learn more about Nuxt 3.

I am transforming an image on the server side and want to return a base 64 string back to the client:

// server/api/image.js
import imageToBase64 from 'image-to-base64'
export default defineEventHandler(async (event) => {
  const param = useQuery(event)
  const url = 'https://images-assets.nasa.gov/image/' + param.query + '/' + param.query + '~thumb.jpg'
  return await imageToBase64(url)
    .then(response => {
        return response // base 64
      })
    .catch(error => console.log(error))
})
// test.vue
const base64 = await $fetch(`/api/image?query=${el.id}`)

But I got an 431 error and don't know the right approach to fix the problem.

GET http://localhost:3000/9j/4AAQSkZJRgABAQAAAQABAAD/wAALCAIAAoABAREA/8QAHwAAAQUBACQoL/ [...] [HTTP/1.1 431 Request Header Fields Too Large 0ms]

Do you have any ideas? I only read about to clearing my browser cache...

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