I need to hit an api using "require" npm in node. The api requires raw put data (not put fields). How do I do this using request npm?
example raw put data I need to send:
var body = {
"id": 123,
"squares": [
{
square_id: 345,
color: "#ccc"
},
{
square_id: 777,
color: "#fff"
}
]
}
I'm trying this but it's not working:
request({
method: "PUT",
uri: UPDATE_GAME,
multipart: [{
'content-type': 'application/json',
body: JSON.stringify(body)
}]
}