Does anyone know how to make a 'PUT' request in Dart?
I did this but then I don't know how to continue:
HttpRequest request =new HttpRequest();
request.open("PUT", url);
...
Thanks.
答案 0 :(得分:2)
var resp = await HttpRequest.request('http://someurl.com',
method: 'PUT', sendData: data);
// Do something with the response.
或
HttpRequest.request('http://someurl.com',
method: 'PUT', sendData: data)
.then((HttpRequest resp) {
// Do something with the response.
});