PUT request in Dart

186 views Asked by At

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

There are 1 answers

2
Günter Zöchbauer On
var resp = await HttpRequest.request('http://someurl.com', 
    method: 'PUT', sendData: data);
// Do something with the response.

or

HttpRequest.request('http://someurl.com', 
    method: 'PUT', sendData: data)
.then((HttpRequest resp) {
  // Do something with the response.
});