Answer the question
In order to leave comments, you need to log in
Request.post how to prevent object serialization query string?
itemlist is an array of strings;
I send data in this way, but on the receiving side, when deserializing, I get not an array of items, a set of variables "items[1]" "items[2]" items[3]" and so on, how to fix this?
although in another project everything works fine
let data = { steamid: this.gameData.winner.steamid, items: itemlist };
request.post(
'http://localhost:4000/senditems',
{ form: {data:data} },
function (error, response, _body) {
if (!error && response.statusCode == 200) {
}
});
Answer the question
In order to leave comments, you need to log in
Send json if the receiving party is also you, parsing it is not a problem.
Update
In general, the request should change your warm date into a string like steamid=111&items=1&items=2, and in fact, if you correctly accept such data, then this is not a problem either.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question