I can't get cookie files for Axios.
-
When using fetch, I successfully got a bunch of files in my browser. Used the following request:
fetch("https://url", { method: "POST", credentials: "include", headers: { "Content-Type": "application/json", }, body: JSON.stringify(data), })
But when I try to use Axios, I get an answer from the server, but there are no files.
axios.post("https://url", data, { params: { credentials: "include", headers: { "Content-Type": "application/json", }, }, });
? What's the problem?
I get a bunch of files on the request, but they don't stay in the browser.
-
We need a parameter.
withCredentials
axios.post('your_url', data, {withCredentials: true});