The Content-Type Header Explained (with examples) | Web Development Tutorial

preview_player
Показать описание
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:

For your reference, check this out:

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!
Рекомендации по теме
Комментарии
Автор

You are the best.
Do you know node js?
Your explanation are the best.

eyalshnitzerful
Автор

Where do you come from? I'm just wondering.

ydxyrbx