#FreePalestine 🇵🇸

Muhammed Mukhthar CM

Bearer Token Authentication in Flutter

Oct 10, 2021

When working with APIs, it is common to have to deal with a different types of authentication methods. Bearer token Authentication is one of them.

If an API requires us to authenticate through a bearer token, all we have to do is pass an Authorization header with the API request. We have to put the API key after the word Bearer.

Example shown below

var response = await http.get(
     Uri.parse(
        'https://example.com/api/your-cool-api'),
        headers: {
        'Authorization':
            'Bearer <--your-token-here-->',
    },
);

Join my email list to get the latest posts and updates.


Support Me