Getting the below issue when I pass the value in variable in json.encode not getting the excepted response, but I when pass the value without variable getting proper response I tried using map and different headers not able to get the exact issue.
Not working
String getvalue = “response-value”; var _body = json.encode({"context": getvalue});
var res = await http.post(link, headers: { "Content-Type": "application/json", }, body: _body );
working
var _body = json.encode({ "responseValue”: "response-value" });
var res = await http.post(link, headers: { "Content-Type": "application/json", }, body: _body );
It is solved, there was issue an issue in the backend api which got solved know.