Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow method to be inside options #73

Open
GiedriusVil opened this issue Jun 1, 2022 · 1 comment
Open

Allow method to be inside options #73

GiedriusVil opened this issue Jun 1, 2022 · 1 comment

Comments

@GiedriusVil
Copy link

Axios allows to execute request set in options, rather than used as a method:
await axios({ url: 'https://httpbin.org/post', method: 'post' });

Could we have the same in Cachios?

@AlbinoDrought
Copy link
Owner

Cachios doesn't currently work when called as a function (is this easy to add? I've never done this myself).

As an alternative, there is support for axios.request: https://runkit.com/albinodrought/62979de32563a4000865bbff

const cachios = require('cachios');

(async () => {
    console.log(await cachios.request({ url: 'https://httpbin.org/post', method: 'post' }));
})();

Would this work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants