http-status-code-400

JSON bad format in Post method

烂漫一生 提交于 2021-02-11 12:48:53
问题 I'm trying to submit a POST request, but I got error status code 400 because the data I'm sending is in bad format but I don't know how to format that. The web API expected this format(The web API is working perfectly, if I send the data by Postman I don't have any trouble): [{ "word": "string", "box": 0 }] And this is what I am sending: "["{\"word\": \"Value\", \"box\": 0 }"]" Any idea how to format it? This is the entire code simplified: <form onsubmit="handlePostSubmit()" id="formPost">