Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#41248 closed defect (bug) (invalid)

Resource interpreted as Document but transferred with MIME type application/json

Reported by: casiepa's profile casiepa Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.8
Component: REST API Keywords:
Focuses: rest-api Cc:

Description

Lauching a /wp-json/wp/v2/posts seems to result in a warning in chrome console that says
"Resource interpreted as Document but transferred with MIME type application/json"

Change History (3)

#1 @rmccue
7 years ago

  • Keywords reporter-feedback added

How exactly are you using the REST API? What code is sending the request to the REST API?

#2 @casiepa
7 years ago

  • Keywords reporter-feedback removed

Plain browser. Just open Chrome and go to e.g. https://make.wordpress.org/core/wp-json/wp/v2/posts
Open the Developer Tools and refresh if needed to see the warning.

#3 @rmccue
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Aha, sorry for the delayed reply here.

The "Resource interpreted as Document" warning is because you loaded the data directly in the browser, rather than requesting it from a HTML document. This same thing occurs if you load an image URL directly. This isn't an error, but rather the browser telling you that you're loading data directly rather than a document (HTML page).

Note: See TracTickets for help on using tickets.