Carlos Aguni

Highly motivated self-taught IT analyst. Always learning and ready to explore new skills. An eternal apprentice.


D3js JSON POST v3 v5 v7

10 Oct 2022 »

How do I post parameter on d3.json?

https://stackoverflow.com/questions/14970578/how-do-i-post-parameter-on-d3-json

v3

   d3.json(url,function(error, data) {
       ...
    })
   .header("Content-Type","application/json")
   .send("POST", JSON.stringify({year: "2012", customer: "type1"}));

v4 >

d3.json("http://automation:9000/post/jira-test/jira-users",{
  method: "POST",
  body: JSON.stringify(payload),
  headers: {
    'Content-type': "application/json"
  }}).then(rs => {
  console.log(rs)
})