https://api.twitch.tv/helix/streams?user_login=easywithaces
This API endpoint does not require authentication.
As the response says you must provide a valid ClientID header.
As per the docs
The example request is
curl -H 'Client-ID: uo6dggojyb8d6soh92zknwmi5ej1q2' \
-X GET 'https://api.twitch.tv/helix/streams?first=20'
This is not a Flutter support forum.
Client ID should be sent as a Client-ID: whatever header
ClientID and Secret allows you to generate an App Access Token, which can be sent as an Authorization header Authorization: Bearer GeneratedToken But you still should send the ClientID header with it.
ClientID and Secret can be uses to generate a User Access Token, and that token can be sent as a Authorization header.
Currently you can’t get non authenticated requests working.
From my reading it should be (I can’t test this I don’t know flutter or have a suitable environment setup)
import 'dart:html';
import 'dart:convert';
void main() {
HttpRequest.request(
'https://api.twitch.tv/helix/streams?user_login=easywithaces',
method: 'GET',
requestHeaders: {
'Client-ID': 'YourClientID'
}
)
.then((resp) {
print(resp.responseUrl);
print(resp.responseText);
});
}
As I covered here