Code cleanup

This commit is contained in:
Hillel Coren 2021-10-24 15:20:39 +03:00
parent 16bc3f81b9
commit 9a417c41be
1 changed files with 10 additions and 7 deletions

View File

@ -80,18 +80,21 @@ class WebClient {
if (multipartFiles != null) { if (multipartFiles != null) {
response = await _uploadFiles(url, token, multipartFiles, data: data); response = await _uploadFiles(url, token, multipartFiles, data: data);
} else { } else {
final client = http.Client(); final headers = _getHeaders(
response = await client
.post(
Uri.parse(url),
body: data,
headers: _getHeaders(
url, url,
token, token,
secret: secret, secret: secret,
password: password, password: password,
idToken: idToken, idToken: idToken,
), );
//print('Headers: $headers');
final client = http.Client();
response = await client
.post(
Uri.parse(url),
body: data,
headers: headers,
) )
.timeout( .timeout(
Duration( Duration(