I'm using superagent and I faced a problem with dynamic method name.
For every method I shoud write:
request
.get(url)
request
.post(url)
Is there any way to pass method name as parameter to superagent like that done in axios
axios({
method: 'post',
url,
data
});
You can also use like below check docs
request('GET', url).end(callback);// and pass your first param as http verb 'GET','POST', etc...
Instead just
request.get(url);
Or
request.post(url);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With