HTTP Headers kya hai?

 

HTTP Headers kya hai?

HTTP Headers


HTTP Headers web browser aur server ke beech hone wali communication (message) ka ek part hote hain.
Ye headers browser ya server ko important information dete hain — jaise content type, language, security, cookies, cache rules, etc.


Simple Definition:

HTTP Headers wo short messages hote hain jo HTTP request aur HTTP response ke sath send hote hain — ye batate hain ki data kaise handle karna hai.


🧩 2 Types of HTTP Headers:

TypeKaun send karta hai?
Request HeadersBrowser → Server ko bhejta hai
Response HeadersServer → Browser ko bhejta hai

🔄 HTTP Communication Example:

  1. 🧑‍💻 User browser me type karta hai:
    https://example.com

  2. 📤 Browser send karta hai Request + Headers
    (e.g., User-Agent, Accept-Language, etc.)

  3. 📥 Server send karta hai Response + Headers
    (e.g., Content-Type, Cache-Control, Set-Cookie, etc.)


🔍 Common HTTP Headers (With Explanation):

📤 Request Headers:

HeaderMeaning
User-AgentKaunsa browser/device use ho raha hai
AcceptBrowser kaunsa content format chahta hai (e.g., text/html, application/json)
Accept-LanguageLanguage preference (e.g., en-US, hi-IN)
AuthorizationSecure access ke liye token/password
CookieClient-side stored cookies server ko bhejta hai

📥 Response Headers:

HeaderMeaning
Content-TypeServer ne kaunsa content bheja (e.g., text/html, image/png)
Cache-ControlBrowser kitne time tak content cache kare
Set-CookieServer client me new cookie set karta hai
LocationRedirection ke liye naya URL
Access-Control-Allow-OriginCORS ke liye (kya allow hai, kya nahi)

🔐 Example Response Header:

http
HTTP/1.1 200 OK Content-Type: text/html Cache-Control: no-cache Set-Cookie: session_id=12345; Path=/;

🎯 HTTP Headers Kyu Important Hai?

Use CaseExplanation
SecurityAuthentication, cookies, access control
PerformanceCaching, compression, file type handling
SEO & AnalyticsLanguage, geo-location, redirect info
Cross-Origin (CORS)3rd-party access control

Comments

Popular posts from this blog

Business ko listing websites par submit karna kya hota hai?"

Excel Basic Short Keys ?

Robots.txt SEO me kis purpose se use ki jaati hai?"