问题
i HAVE jquery request
$.ajax({
type: "GET",
url: "http://6232423.212342343.100.89:9000/api/v2/content/categories/",
xhrFields: {
withCredentials: true
},
});
how do I make the same but in axios? I tried like this:
axios.get(portal.categoriesUrl,
{xhrFields: {
withCredentials: true
}}
)
but didn't work
回答1:
axios.get(url, { withCredentials: true })
see docs https://github.com/mzabriskie/axios
来源:https://stackoverflow.com/questions/45589448/rewrite-jquery-ajax-request-in-axios-and-set-xhrfields