Read the statement by Michael Teeuw here.
axios request returns no data, while http request does
-
Did you ever find out the answer to this, i’m having the same issue.
-
No unfortunately not.
Above addition did not help.I’m getting the feeling that the axios requests somehow closes before the data field is being returned. Haven’t tried much since it is not highest priority for me. But would appreciate any idea/suggestion.
-
for some reason it doesn’t seem to like the axios user agent. Changing it to something else appears to work. Example:
axios.defaults.headers.common['User-Agent'] = 'PostmanRuntime/7.26.2';
-
@sharklaser many servers use the user-agent string to generate different content , as the ‘browsers’ all support different things, so a random string as user-agent will fail
-
@sharklaser said in axios request returns no data, while http request does:
:
axios.defaults.headers.common[‘User-Agent’] = ‘PostmanRuntime/7.26.2’;That was the solution! Thanks!!