Support Forum [ All Topics | New Topic ]

Thread: Getting error_code 1001

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


>> add a comment
Raj
05/26/2019 03:53


1 Replies:

Please try the format below.

{
"request": {
"header": {
"username": "awesome",
"password": "jsonrocks"

},
"body":{
"shape": "round",
"size": 2.10,
"color": "E",
"clarity": "VS2"
}
}
}

>> add a comment
RapNet Support
6/27/2019 6:53:00 PM