getPostAndParent static method
Future<PostSearchResponseResponse>
getPostAndParent(
- HttpClient client,
- String childPostId,
- String showbanned
Returns the post specified and its immediate parent.
Implementation
static Future<PostSearchResponseResponse> getPostAndParent (
HttpClient client,
String childPostId,
String showbanned,
) async {
final Map<String, dynamic> params = Map<String, dynamic>();
final String _childPostId = '$childPostId';
params['showbanned'] = showbanned;
final HttpClientConfig config = HttpClientConfig('GET', '/Forum/GetPostAndParent/$_childPostId/', params);
config.bodyContentType = null;
final HttpResponse response = await client.request(config);
if(response.statusCode == 200) {
return PostSearchResponseResponse.asyncFromJson(response.mappedBody);
}
throw Exception(response.mappedBody);
}