http icon indicating copy to clipboard operation
http copied to clipboard

Sending a custom http method

Open alirezat66 opened this issue 4 years ago • 2 comments

Hi, I wanna use a method like 'CLAIM' instead of Get, post, delete, etc. How can do that?

alirezat66 avatar May 02 '20 16:05 alirezat66

Have you found a solution?

tommygiesbrecht avatar Oct 12 '21 05:10 tommygiesbrecht

Just ran into this little issue myself. The solution is to just construct the request yourself and then send it E.g:

makeClaimRequest(url) {
  final response =
          await http.Request("CLAIM", url).send().then(http.Response.fromStream);
  // Do stuff with the response...
}

There might be better ways than this, but this is what I figured out after poking around at the lib a little bit

vanceism7 avatar Sep 02 '22 23:09 vanceism7