New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to request anonymously via Axios? #2455
Comments
I just tried to do the same with fetch and fetch(url, {
credentials: 'omit',
}).then((response)=>{
return response.text();
}).then((data)=>{
console.log(data);
}).catch(err=>{
console.log(err);
}) is |
hi @geongeorge , the BTW, when I set the headers same as you in front-end, the program will report an error:
so I remove it and set the headers in backend like this:
|
Forget the headers part. Fetch seemed to work out of the box with |
@geongeorge Are you using axios with React, #1852 may solve your problem. |
I was using this with nuxt js (vue) |
Had the same problem and found out something new: Which is strange. And yes the withCredentials configuration variable doesn't seem to have any effect on this at all. |
Bumping this, since I'm observing the same problem @Doogiemuc mentioned - same origin requests ignore |
It sounds like this problem may be a limitation of the XMLHttpRequest.withCredentials property. The Axios readme implies that this feature only works cross-site: // `withCredentials` indicates whether or not cross-site Access-Control requests
// should be made using credentials
withCredentials: false, // default Would it be worth updating the docs to make this limitation clearer and/or throwing a warning when this feature is used outside of a cross-site request? (Also, thanks to @hetzbr for the heads-up on this issue! 😄 ) |
Any news about it? Having the same issue. |
Any solution? experiencing the same issue under a nuxt project |
Still nothing? :c |
This seems to be working as expected for me.
axios version: 0.21.1 |
Any updates on the issue, we're in the same situation, and fetch works perfectly with This gets more problematic since Axios automatically includes Cookies, if we wanted to use Axios for things like Upload requests and showing progress which currently I understand that this is a limitation of |
I'm having the same issue. I find this odd that a specification is made into mandatory. |
It doesn't work for me either with the current version (0.27.2). |
Axios is tricky but I have solved this problem in the large code bases. There is a best way that solves it but needs then a network protocols security system usually for the application AJAX to avoid DoD problems but if you are familiar with SOAP or REST API's it's like these. What you do is write a service call to customers created index in the DOM it will see it as a null cookie. This is then sessioned in to the Axios API call in pattern is decorated (I've also had an engineer propagate this although not safe for end to end testing trying to reference MVC which takes really steep math proofs to get truthful in making that simplified into that pattern form.) It's a matter of getting a simple model around to view both your active object while maintaining a connection to the network session, foreboding http protocol standards and setting the flags also will work but the relationships to provocation of issues in your network exponentially increases. If you share your implementation I'd be happy to answer questions but it will not be a testable implementation hence it's hacker ugly yet to find anything but I have custom scripts that made it work not ever keeping it for application in any code base. |
@geongeorge @creinelt @eduardotrzan @mamsoudi @maciej-trebacz guys did you find any solution to this problem ???? Experiencing the same problem and cant fix it for long time 😔 |
I think I used fetch instead of axios at the time to solve this. You should ask to reopen this issue or open a new one. I remember I tried a lot at the time as well. But this is an old issue. If Axios updates have not fixed it you should definitely get this re-opened |
Surely this should be reopened @geongeorge - I'm having the same problem at the moment and I'd rather not replace all my axios usage with fetch! :-D |
Noticing same problem. No way to remove cookies in a request. You can't delete cookies, override header, to |
I want to remove Cookie header using axios for a front-end served on same IP:PORT as back-end, is there no way?? |
I want to send a GET request to a url via axios.
It seems the website can recognize me via cookies and is redirecting the url to a page where logged in users are moved to.
I want to send a request as if I were doing it from an incognito tab
I have tried using
withCredentials: false
config.This does not seem to have any effect with
true
orfalse
in my case.The text was updated successfully, but these errors were encountered: