getProfileResponse function
Created By Guru (guru@smarttersstudio.com) on 28/06/20 12:54 PM
Implementation
Future<LinkedInProfile> getProfileResponse({
required String accessToken
}) async{
final response = await http.get(Uri.parse(linkedInProfileUrl),headers: {
'Authorization': 'Bearer $accessToken'
});
if(response.statusCode == 200)
return linkedInProfileFromJson(response.body);
else {
final error = profileErrorFromJson(response.body);
throw AuthorizationErrorResponse(
errorDescription: error.message,
status: error.status
);
}
}