responseType property
responseType indicates the type of data that the server will respond with
options which defined in ResponseType are json
, stream
, plain
.
The default value is json
, dio will parse response string to json object automatically
when the content-type of response is 'application/json'.
If you want to receive response data with binary bytes, for example,
downloading a image, use stream
.
If you want to receive the response data with String, use plain
.
If you want to receive the response data with original bytes, that's to say the type of Response.data will be List
Implementation
ResponseType? responseType;