Open D00mch opened 2 years ago
And I am not sure if it should be possible
In your case itβs not even possible (short of Function.apply) because the http methods functions donβt have the same signature: body and encoding are not present on all methods.
Ah, that was stupid mistake, that I tried to pass http/get
as method
. But if I pass http/post
or http/put
, it doen't work either. And with the put
and post
β should it work?
(method url .& :encoding XX :body YY)
may work.
Issue #9 is related I believe.
I write wrappers over http.dart, and can't figure out how to pass
http/<method-name>
as an argument to the function.For example, I have my post method as:
Having this, I want to avoid writing the same stuff for get, put, delete, and instead use one function and pass 'method' to it like:
logs
``` You rock! π€ Performing hot reload... βββ‘ EXCEPTION CAUGHT BY WIDGETS LIBRARY ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ The following NoSuchMethodError was thrown building Builder(dirty): Closure call with mismatched arguments: function 'get' Receiver: Closure: (Uri, {Map