You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
726 B
26 lines
726 B
3 years ago
|
import 'dart:io';
|
||
|
|
||
|
import 'package:bytedesk_kefu/util/bytedesk_constants.dart';
|
||
|
import 'package:bytedesk_kefu/util/bytedesk_utils.dart';
|
||
|
import 'package:sp_util/sp_util.dart';
|
||
|
import 'package:http/http.dart' as http;
|
||
|
|
||
|
class BytedeskBaseHttpApi {
|
||
|
//
|
||
|
String client = BytedeskUtils.getClient();
|
||
|
String baseUrl = BytedeskUtils.getBaseUrl();
|
||
|
//
|
||
|
final http.Client httpClient = http.Client();
|
||
|
|
||
|
BytedeskBaseHttpApi();
|
||
|
//
|
||
|
Map<String, String> getHeaders() {
|
||
|
String? accessToken = SpUtil.getString(BytedeskConstants.accessToken);
|
||
|
Map<String, String> headers = {
|
||
|
HttpHeaders.contentTypeHeader: "application/json",
|
||
|
HttpHeaders.authorizationHeader: "Bearer $accessToken"
|
||
|
};
|
||
|
return headers;
|
||
|
}
|
||
|
}
|