Aussie programmer, based in Finland. Specialising in web, mobile and systems development: Javascript, Typescript, React, Terraform, Objective-C.
โก Social: / Keybase
๐ Buttercup: buttercup.pw / GitHub / Keybase
Request cowl for making requests from NodeJS/Browser/React-Native
License: MIT License
Aussie programmer, based in Finland. Specialising in web, mobile and systems development: Javascript, Typescript, React, Terraform, Objective-C.
โก Social: / Keybase
๐ Buttercup: buttercup.pw / GitHub / Keybase
I'm looking at cowl
in relation to buttercup/buttercup-core#229, and it is tough to know the best way to migrate from fetch. It's also tough to know what the advantages are of cowl
over fetch
from the readme.
Here are the possible options for fetch.
method: 'POST', // *GET, POST, PUT, DELETE, etc.
mode: 'cors', // no-cors, *cors, same-origin
cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
credentials: 'same-origin', // include, *same-origin, omit
headers: {
'Content-Type': 'application/json'
// 'Content-Type': 'application/x-www-form-urlencoded',
},
redirect: 'follow', // manual, *follow, error
referrer: 'no-referrer', // no-referrer, *client
body: JSON.stringify(data) // body data type must match "Content-Type" header
As I understand it, mode
, cache
, credentials
, redirect
, and referrer
do not have analogs in cowl. Is this correct?
For responses, the API seems pretty straightforward, with the only difference that cowl
stores the body in a buffer and that it does not automatically parse the body given the response type.
Also, fetch has some logic under the hood to do things like guess the Content-Type
and Content-Length
- are these present in cowl
?
In general, what would be the main advantages of using cowl
over fetch
? Because fetch
is battle-tested, has very few bugs, and will be known by most new contributors to a JS project, one would need IMO a pretty compelling reason to migrate to something new. Not saying that cowl
lacks this, but rather that it is not apparent what the advantages are when reading the README.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.