Skip to content

Making a custom request to the Twitter API

Roberto Doering edited this page Jun 1, 2020 · 1 revision

When an endpoint is not implemented yet, a request still can be made by manually using the TwitterApi.client.

// Make an authenticated GET request to 'users/show'
twitterApi.client.get(
  Uri.https('api.twitter.com', '1.1/users/show.json',
  <String, String>{
    'user_id': '1068105113284300800',
  },
);

// Make an authenticated POST request to 'friendships/create'
twitterApi.client.post(
  Uri.https('api.twitter.com', '1.1/friendships/create.json'),
  body: <String, String>{
    'user_id': '1068105113284300800',
  },
);
Clone this wiki locally