getAttachmentContent method

Future<Map<String, dynamic>> getAttachmentContent({
  1. required String id,
  2. bool? redirect,
})

Returns the contents of an attachment. A Range header can be set to define a range of bytes within the attachment to download. See the HTTP Range header standard for details.

To return a thumbnail of the attachment, use Get attachment thumbnail.

This operation can be accessed anonymously.

Permissions required: For the issue containing the attachment:

Implementation

Future<Map<String, dynamic>> getAttachmentContent(
    {required String id, bool? redirect}) async {
  return await _client.send(
    'get',
    'rest/api/3/attachment/content/{id}',
    pathParameters: {
      'id': id,
    },
    queryParameters: {
      if (redirect != null) 'redirect': '$redirect',
    },
  ) as Map<String, Object?>;
}