acceptFriendRequest static method

Future<BooleanResponse> acceptFriendRequest(
  1. HttpClient client,
  2. String membershipId
)

Accepts a friend relationship with the target user. The user must be on your incoming friend request list, though no error will occur if they are not.

Implementation

static Future<BooleanResponse> acceptFriendRequest (
    HttpClient client,
    String membershipId,
) async {
    final Map<String, dynamic> params = Map<String, dynamic>();
    final String _membershipId = '$membershipId';
    final HttpClientConfig config = HttpClientConfig('POST', '/Social/Friends/Requests/Accept/$_membershipId/', params);
    config.bodyContentType = null;
    final HttpResponse response = await client.request(config);
    if(response.statusCode == 200) {
        return BooleanResponse.asyncFromJson(response.mappedBody);
    }
    throw Exception(response.mappedBody);
}