Axios with React gives 200 (304 in network tab), but gives junk HTML response

axios 304 not modified
304 not modified angular 6
304 not modified node js
getting 304 instead of 200
304 undefined
wordpress 304 not modified
json-server 304
http 304

I seem to be missing a key piece here. Any ideas?


    retrieveConfig = () => {const { locnNbr } =;
    axios.get(`/some/uri/stuff`).then(res => 
        {console.log('retrieveConfig res', res);
        this.setState({config: res. data});

componentDidMount = () => {

retrieveConfig = () => {
   .then(res => console.log(
   .catch(err => console.log(err));

I hope this fixes your problem.

Axios response data with HTML junk and status 200 · Issue #889 , Axios return entire HTML source code as with response.status 200 I tried to insert the invalid URL into axios.get() and check what is This has nothing to do with Axios but with the responses your server is returning. /​accessing-internal-api-with-react-axios-on-heroku/43036770#43036770. {// `data` is the response that was provided by the server data: {}, // `status` is the HTTP status code from the server response status: 200, // `statusText` is the HTTP status message from the server response statusText: 'OK', // `headers` the HTTP headers that the server responded with // All header names are lower cased and can be accessed

Html response you got only for mobile and it will work from postman because the url you are trying to hit from server mobile will not able to hit. So you add the cer to your mobile.

public certificate of server where as postman allows it but mobile does not allow to hit all server urls

Axios html response, Pentaho repository API returns junk data as response while exporting excel file In Chrome, I can see it in on the Network tab (see image), but I can't find it on the React and Redux code. rendering html in vue after axios response submitted 5 Our assyst solution gives you unified IT management in a single cloud app. The list, obtained by Axios, includes Huawei, Hangzhou Hikvision, China Railway Construction Corporation, and China Telecommunications Corporation. Why it matters: President Trump has the authority to invoke emergency economic powers, including sanctions, against the 20 companies on the list.

Consider double checking your URLs.

I'm assuming you're trying to reach a REST API endpoint but you're getting a web page as your response, which for me would suggest you're hitting the wrong port on the right domain. I believe Axios defaults to using port 8080 (web default), and it's unlikely your API is running on that port. So make sure you're specifying your URL like:


If you could share which URL you're using in browser and in Postman that might give more information on what's going on differently there.

The 200/304 thing makes sense from that perspective as well. It's a 200 since the request went fine but Chrome is caching the request for that web page and it's reporting that it hasn't changed (that's what 304 means).

Introduction to web scraping with Node.js, Axios is a "promise based HTTP client for the browser and node.js" and we'll use it to get html from any chosen website. Cheerio is like jQuery but for the server. 200) { const html =; const $ = cheerio.load(html); } }, (error) to the Network tab to see what external API calls the page is using. Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. Provide details and share your research! But avoid … Asking for help, clarification, or responding to other answers. Making statements based on opinion; back them up with references or personal experience. To learn more, see our tips on writing great

Sometimes I come across this issue in Firefox Developer Edition and I have not figured out why this happens (I believe it has to do with the response headers).

I manage to fix it every time by clearing the browser's cache.

[PDF] React Quickly, __html . children. —Sets the content of the element via this.props.children . Fo “​React Quickly will ease your adoption of React by giving you a clear with React​.js, covering not just React itself but the ecosystem surrounding it. I've 6.2 Responding to DOM events not supported by React 131 14.6 Quiz answers 304. Response Object. The Response Object returned by a fetch() call contains all the information about the request and the response of the network request. Metadata headers. Accessing the headers property on the response object gives you the ability to look into the HTTP headers returned by the request:

Create Responsive, Fast and Reliable PWAs Using Angular , Last but not least, to persist our data, we will use Firebase Firestore, which gives us the best passivity to store and retrieve our data as quickly and possible with  In a multipart/form-data body, the HTTP Content-Disposition general header is a header that can be used on the subpart of a multipart body to give information about the field it applies to. The subpart is delimited by the boundary defined in the Content-Type header. Used on the body itself, Content-Disposition has no effect.

GitHub · Enterprise, By default, the network tab shows all requests being made. The JavaScript Console provides two primary functions for developers testing web pages and  A regular URL would end in .com, .php, .org, .html, or just have an extension, while a directory URL would usually end with a “/”. Most servers are configured to disallow directory browsing for security reasons. ,​- Images) 2018-03-29T20:18:45.652057+00:00​response-to- -oscar-finances-1522264587-7fcf1924-b304-485c-9983-​5deed9285285.html Oscar raised $165 million in new funding but is still hemorraging cash. response is used to populate the data we’re going to return to the client. In this case with: res.statusCode = 200. We set the statusCode property to 200, to indicate a successful response. We also set the Content-Type header: res.setHeader('Content-Type', 'text/plain') and we end close the response, adding the content as an argument to end():