In this video we take a look at the Content-Type header part of the HTTP protocol. In a nutshell, the Content-Type header indicates what kind of data (MIME Type) is being sent.
As an example, we'll be setting the Content-Type as "application/json" in a PHP script which returns a JSON string. We then use a similar technique to output CSS without creating a ".css" file.
The Content-Type should be used to make your server-side code "proper". It also allows you to create dynamic resources (i.e. images, style sheets, JavaScript etc.)
Support me on Patreon:
/ dcode - with enough funding I plan to develop a website of some sort with a new developer experience!
For your reference, check this out:
https://developer.mozilla.org/en-US/d...
Follow me on Twitter @dcode!
If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
On this page of the site you can watch the video online The Content-Type Header Explained (with examples) | Web Development Tutorial with a duration of hours minute second in good quality, which was uploaded by the user dcode 31 August 2018, share the link with friends and acquaintances, this video has already been watched 52,423 times on youtube and it was liked by 544 viewers. Enjoy your viewing!