You can use flutter
http.post in the format below to add header credentials to your post request. body will be the actual data you are sending. This snippet is from one of my use case
Map<String, dynamic> body = {
'data': json.encode(
{'USER_NAME': email, 'PASSWORD': password, "AUTH_TYPE": "LOGIN"},
),
'actionType': 'LOGIN SELECT',
'sessionId': '0',
};
String url = '${Swift.apiUrl}/login';
final response = await http.post(
url,
body: body,
headers: {
"Accept": "application/json",
"Content-Type": "application/x-www-form-urlencoded"
"Authorization": "Apitoken yourpasskeystring"
},
encoding: Encoding.getByName("utf-8"),
);