uploadMedia abstract method

Future<MastodonResponse<MediaAttachment>> uploadMedia({
  1. required File file,
  2. File? thumbnail,
  3. String? description,
  4. MediaFocalPoints? focus,
})

Creates a media attachment to be used with a new status.

The full sized media will be processed asynchronously in the background for large uploads.

Parameters

  • file: The file to be attached, encoded using multipart form data.

  • thumbnail: The file to be attached, encoded using multipart form data.

  • description: A plain-text description of the media, for accessibility purposes.

  • focus: Two floating points (x,y) ranging from -1.0 to 1.0.

Endpoint Url

  • POST /api/v2/media HTTP/1.1

Authentication Methods

  • OAuth 2.0

Required Scopes

  • write:media

Reference

Implementation

Future<MastodonResponse<MediaAttachment>> uploadMedia({
  required File file,
  File? thumbnail,
  String? description,
  MediaFocalPoints? focus,
});