add content-type to api/ab/get
This commit is contained in:
parent
679d3d9868
commit
90a43a5110
@ -27,7 +27,9 @@ class AbModel {
|
|||||||
abError.value = "";
|
abError.value = "";
|
||||||
final api = "${await bind.mainGetApiServer()}/api/ab/get";
|
final api = "${await bind.mainGetApiServer()}/api/ab/get";
|
||||||
try {
|
try {
|
||||||
final resp = await http.post(Uri.parse(api), headers: getHttpHeaders());
|
var authHeaders = getHttpHeaders();
|
||||||
|
authHeaders['Content-Type'] = "application/json";
|
||||||
|
final resp = await http.post(Uri.parse(api), headers: authHeaders);
|
||||||
if (resp.body.isNotEmpty && resp.body.toLowerCase() != "null") {
|
if (resp.body.isNotEmpty && resp.body.toLowerCase() != "null") {
|
||||||
Map<String, dynamic> json = jsonDecode(resp.body);
|
Map<String, dynamic> json = jsonDecode(resp.body);
|
||||||
if (json.containsKey('error')) {
|
if (json.containsKey('error')) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user