muniz95
muniz95

Reputation: 13

Send a file via POST using Dart (server-side only)

I am developing a Telegram Bot, and I need to send a file via POST as attachment to an user (e.g. a .txt file). Upon this, I have two questions:

Any ideas?

Upvotes: 0

Views: 604

Answers (1)

Argenti Apparatus
Argenti Apparatus

Reputation: 4013

I infer that you are using the Dart Pub http package. Briefly looking at the documentation it appears that both multi part and streaming uploads are supported. See the MultipartRequest and StreamedRequest classes. (I have not used these myself but they seem straightforward.)

https://www.dartdocs.org/documentation/http/0.11.3%2B9/http/http-library.html

This question may help with understanding HTTP multipart/form-data file uploads. How does HTTP file upload work?. Others may be able to point to a good resource on streaming uploads.

Upvotes: 1

Related Questions