Closed
Description
axios({
method: 'post',
url: url,
data: querystring.stringify(formData),
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(response => {
console.log(response)
}).catch(err => {
console.log(err)
})
The code above will fail with code 504, what i want is response with code 302 or auto redirect.
request do what i want
request.post({url: url, form: formData/*, followAllRedirects: true*/}, (err,httpResponse,body) => {
console.log(httpResponse.headers)
})
Activity
rubennorte commentedon Apr 2, 2017
Redirects are automatically followed by browsers so you can never get the original 302. It seems that you're server is returning that 504 for the second request.
typo fix axios#800
typo fix #800 (#5193)