I\'m doing an api request uploading an image with
var request = new http.MultipartRequest(\"POST\", uri);
var response = await request.send()
i
Your MultipartRequest
returns a Streamed Response
since you used request.send
. You will need to extract the string value from the response like below:
import 'package:http/http.dart'
var request = new MultipartRequest("POST", uri);
var response = await request.send()
// Extract String from Streamed Response
var responseString = await response.stream.bytesToString();
In this case the responseString
will be just like response.body
of
final response = await post(URL, body : map);