JSON object batch request parse data in reverse way
Mukolajko opened this issue · 1 comments
Mukolajko commented
Hi.
I try to send batch data to geocode API using this example.
let addresses = {
"1": "555 N Highland St, Arlington VA"
}
But instead of returning correct address API tries to parse values from KEY property instead of VALUE property.
Example code in NodeJs
`request.post({url: baseUrl, form: {data: JSON.stringify(addresses)} } ,(e, r, body) =>{
//you will see in response that address is missing completelly
But if you reverse Object like this
let addresses = {
"555 N Highland St, Arlington VA": "1"
}
It works.
Have a nice day.
Mukolajko commented
My bad. All works good, It's just content-type issue. Without header 'content-type': 'application/json' API works incorrect. Hope this helps anyone.