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

89
Vistas
Сan’t send Post-request to last.fm

I'm trying to send a request like in the documentation, but it returns me a response: Invalid parameters - Your request is missing a required parameter

async function unlove_track(track_name,artist) {
            let body = {
                track: track_name,
                artist: artist,
                api_key: 'api_key',
                api_sig: 'api_sig',
                sk: 'sk',
                method: 'track.unlove'
            }
            let response = await fetch(`http://ws.audioscrobbler.com/2.0/`, {
                method: 'POST',
                body: JSON.stringify(body),
                headers: {'User-Agent': '--------'}
            });
            response.json().then(res => {console.log(res)})
        }

Screenshot from documentation

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

0

The documentation doesn't make explicit mention of it, but if you look at the API clients they link to (e.g. this PHP one) you can see that the request body is expected to be formatted as application/x-www-form-urlencoded and not the JSON you are using.

Use URLSearchParams to generate your data in that format.

Don't forget to include the Content-Type request header.

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