Closed abraham closed 1 year ago
uploadAttachment
v2
publishStatus
mediaIds
http
MultipartRequest
post
Validated with:
import 'package:mastodon_dart/mastodon_dart.dart'; const bearerToken = ''; final website = Uri.parse('https://mstdn.party'); void main() async { var client = Mastodon(website); client.token = bearerToken; var attachment1 = await client.uploadAttachment( 'cat.jpg', description: 'cat', ); print('a1 ${attachment1.id}'); // var attachment2 = await client.uploadAttachment('cat.jpg'); // print('a2 ${attachment2.id}'); var response = await client.publishStatus( status: 'Testing with media', mediaIds: [attachment1.id], ); print('s1 ${response.id}'); var response2 = await client.publishStatus(status: 'Testing without media'); print('s2 ${response2.id}'); }
uploadAttachment
to apiv2
publishStatus
to a singlemediaIds
value ashttp
doesn't support list valuesMultipartRequest
files support topost
methodsValidated with: