String url = 'http://jaria.kg/apis/v1/create/';
var response = await dio.post(url,
data: formData,
options: Options(
headers: {'Content-type': 'application/json; charset=UTF-8'}));
print(response.data);
return response.data;
returns Http status error [301]
CodePudding user response:
please test it on postman,use https instead of http.
CodePudding user response:
You can do something like this.
var response = await dio.post('http://jaria.kg/apis/v1/create/',
data: formData,
options: Options(
followRedirects: false,
validateStatus: (status) { return status < 500; },
headers: {'Content-type': 'application/json; charset=UTF-8'}
),
);
