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

169
Views
why Parameterized POST request to a dummy data api doesnt return complete response?
console.log("JAVASCRIPT called")
let fbtn=document.getElementById("fetchbtn");
fbtn.addEventListener("click",func_to_be_called);
function func_to_be_called()
{
    //xhr object create
    console.log("func called")
    const obj=new XMLHttpRequest();
    obj.open("POST","https://jsonplaceholder.typicode.com/posts",true);
    obj.getResponseHeader("Content-type","application/json")
    obj.onload=function(){
        if (obj.status===201)
        {
            let a=JSON.parse(this.responseText)
            console.log(a)
        }
        else console.log("no response")
    }
    let paras=JSON.stringify({
        title: 'foo',
        body: 'bar',
        userId: 1,
      })
    obj.send(paras);
}![result](https://i.stack.imgur.com/1TGKT.png)

This is my js code that sends a post request to (https://jsonplaceholder.typicode.com/posts) to create a new data entry but response is only showing id of the new data not the parameters i sent

about 4 years ago · Juan Pablo Isaza
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!