3 ms·
You can default to "application/x-www-form-urlencoded" and use "multipart/form-data" if requested, which is essentially how HTML forms work. There's lots of rea
by Beltalowda 4y ago
You can default to "application/x-www-form-urlencoded" and use "multipart/form-data" if requested, which is essentially how HTML forms work. There's lots of reasonable behaviours to choose from and you can discus what the best possible approach is, including throwing an exception, but sending "[object Object]" is not one of the reasonable behaviours.
> Or... just use Axios, I ain't your manager; I get by easily enough with a helper js that gets treeshaked out so that I can just call `postJSON(url, body, opts=null)`
The fact that everyone "just" has to use a wrapper for a basic system API is exactly the problem, especially when this was supposed to be the new shiny thing that would replace the old cruft. Why do I have to add 4 dependencies + 44 "dev dependencies" just to make a HTTP request?
Plus, for my personal projects I want to avoid the "npm ecosystem", and I especially want to avoid any JS build system.