Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

90
Views
С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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!