0

I request from a method in a Vue component with this.$http (from https://github.com/pagekit/vue-resource) like this:

this.$http.post("/some/url", data).then(response => { ... })

In some cases the response may have status code 302 Found and I want to process it in the callback in then. But instead the this.$http.post follows the location URL provided by the first response that is not desired. How do I force this.$http.post not to redirect?

Fomalhaut
  • 8,590
  • 8
  • 51
  • 95
  • Does this answer your question? [Prevent redirection of Xmlhttprequest](https://stackoverflow.com/questions/228225/prevent-redirection-of-xmlhttprequest) – Michal Levý Nov 29 '21 at 16:21
  • Note that vue-resource is [internally using](https://github.com/pagekit/vue-resource/blob/1b2d0c94e0b5b4efbbbb136987401423b84e8cba/src/http/client/index.js#L62) XHR - that's the reason why I linked that answer – Michal Levý Nov 29 '21 at 16:23

0 Answers0