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!
На этой странице сайта вы можете посмотреть видео онлайн The Content-Type Header Explained (with examples) | Web Development Tutorial длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь dcode 31 Август 2018, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 52,423 раз и оно понравилось 544 зрителям. Приятного просмотра!