ERROR:
{
"response": {
"header": {
"error_code": 1001,
"error_message": "Invalid format"
},
"body": {}
}
}
Code :
const fetch = require("node-fetch");
// POST adds a random id to the object sent
fetch('https://technet.rapaport.com/HTTP/JSON/Prices/GetPrice.aspx', {
method: 'POST',
body: {
"shape": "round",
"size": 2.10,
"color": "E",
"clarity": "VS2"
},
headers: {
"Content-Type" : "application/x-www-form-urlencoded",
"username": "XXX",
"password": "XXX"
}
})
.then(response => response.json())
.then(json => console.log(json))
Please let me know if i made any mistake in this code