Safari - Get HTTP Request Response Headers


Let's see an example of how you can get the HTTP Request or Response headers in Safari web browser for macOS,

Let's open Safari and visit google.com and search for the team java and see what the request-response headers are,

Safari - Request Response Header Example
Safari - Request Response Header Example

As you can see in the above gif example, right-click on the webpage and select "Inspect element", go to the network tab, you may see a lot of entries of all kind of files loaded: CSS, images, javaScript, etc, you can select the Documents tab just to see the webpages request - click on Headers and you would see the Request and Response headers.

Request:
:method: GET
:scheme: https
:authority: www.google.com
:path: /search?q=java&client=safari&sxsrf=xxx%xxx&ei=xxx-EPxtaMuAg&oq=java&gs_lcp=xxx&sclient=gws-wiz&ved=xxx
Cookie: CGIC=XXX
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Host: www.google.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15
Accept-Language: en-us
Referer: https://www.google.com/
Connection: keep-alive
Response:
:status: 200
Content-Type: text/html; charset=UTF-8
Set-Cookie: 1P_JAR=2021-07-25-10; expires=Tue, 24-Aug-2021 10:47:57 GMT; path=/; domain=.google.com; Secure; SameSite=none
Set-Cookie: SIDCC=xxx; expires=Mon, 25-Jul-2022 10:47:57 GMT; path=/; domain=.google.com; priority=high
Set-Cookie: __Secure-3PSIDCC=xxx; expires=Mon, 25-Jul-2022 10:47:57 GMT; path=/; domain=.google.com; Secure; HttpOnly; priority=high; SameSite=none
Date: Sun, 25 Jul 2021 10:47:57 GMT
X-Frame-Options: SAMEORIGIN
Content-Encoding: gzip
X-XSS-Protection: 0
Cache-Control: private, max-age=0
Expires: -1
Server: gws
Strict-Transport-Security: max-age=31536000
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"



Recent Posts:




Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Video Tutorials, Code Snippets, How Tos, Blogs, Articles, etc.