Well, i've used axios with Vue a lot, it's more convenient, tbh. But it's an additional dependency, also they are not actively working on currently stalled issues in their repo. Axios has many neat features built-in. But i wonder about the future of this project.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
POST is OK, but GET shouldn't have a response body. You should use querystrings.
Yeah, that's why i set body to
undefined
by default, when calling this wrapper you also can omit a body.You still have
application/json
header, which is affected by CORS.Now, my goto is
axios
, which auto-detect body typeapplication/json
application/x-www-form-urlencoded
Axios also allowes
raise_for_status
anderror
interceptors.However,
axios
uses XMLHttpRequest. Not sure if this matters.Well, i've used axios with Vue a lot, it's more convenient, tbh. But it's an additional dependency, also they are not actively working on currently stalled issues in their repo. Axios has many neat features built-in. But i wonder about the future of this project.