PUT request in Dart

时间:2015-06-15 15:16:33

标签: dart google-chrome-app put

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.

1 个答案:

答案 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.
});