followArtistsOrUsers method

Future<void> followArtistsOrUsers(
  1. List<String> ids,
  2. String type
)

Follows users or artists by ids. type must be either 'artist' or 'user'.

Implementation

Future<void> followArtistsOrUsers(List<String> ids, String type) async {
  assert(type == 'artist' || type == 'user', 'Type must be "artist" or "user"');

  final uri = Uri.https(
    _baseApiHost,
    '/v1/me/following',
    {'type': type},
  );

  final body = {'ids': ids};
  await _putJson(uri, body);
}