FetchData class
Used with the fetch function to send data for the likes of a POST command.
Constructors
-
FetchData.fromBytes(List<
int> bytes, {String mimeType = 'application/octet-stream'}) -
Use the passed
bytesas the source of the FetchData. - FetchData.fromFile(String pathToData, {String? mimeType})
-
Read the FetchData from a file where
pathToDatais the path to the file containing the data to send.pathToDatamay be relative or absolute. If the mimeType isn't passed then we use the file extension to determine themimeTypeif that fails we revert to text/plain. throws FetchException if the file atpathToDatadoes not exist or it is not a file. -
FetchData.fromStream(Stream<
List< stream, {String mimeType = 'application/octet-stream'})int> > -
Use the
streamas the source of the FetchData to send. ThemimeTypedefaults to application/octet-stream - FetchData.fromString(String string, {String mimeType = 'text/plain'})
-
Use a String as the source of the FetchData
The
mimeTypedefaults to text/plain.
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited