-
-
Notifications
You must be signed in to change notification settings - Fork 126
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
Feature: Add fetch
function to utils
#187
Conversation
Shouldn't the options parameter default to |
0e0caec
to
5d3ff6b
Compare
Oops, yep. |
5d3ff6b
to
1251f31
Compare
Currently you decode the received bytes using TextDecoder, but this assumes the received data is actually text. So I can't fetch something like an image using this. |
I would actually go a slightly different with this approach, as in: |
I haven't used the |
I have talked with @kotontrion about this issue, and i think the best approach to handle multiple different ways to parse the i would then appropriately set the 'default' behaviour to string decoding and (if you'd agree with me on that one), and leave the multiple options there (which i have engraved into types) |
97c51ab
to
0ae23a6
Compare
b5d1b3c
to
c45a175
Compare
- Also fix lint
c45a175
to
81b7d4f
Compare
I saw this linked on Discord https://gist.github.com/derekstavis/82c509789ee7ed0954a88592548dd815 |
As already discussed on the Discord, here is my submission for a asynchronous fetch function, that will provide the ability (for now) to add
POST
as well asGET
reqeuests.My design considerations are mostly, that types should do essentially most of the Documentation and i think it does a pretty good job.
An example usage of this function would be:
This example will just print something like:
Gjs-Console-Message: 16:32:47.627: [redacted]: 🌨 +1°C
to the console.