User Tools

Site Tools


http_headers

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
http_headers [2015/09/08 08:44] – luke7858http_headers [2017/02/24 07:57] (current) – luke7858
Line 1: Line 1:
-__**Troubleshooting a website**__. You can replace http://website.com with http://localhost if you wish to test the domain on the local machine +~~NOCACHE~~ 
-<sxh bash> +====== HTTP Headers ====== 
-curl -Iv -X GET 12.34.56.78 -H 'Host: example.com' +{{tabembed>[[curl_basics|Curl Basics, [[website_cloaking|Website Cloaking}}
-</sxh> +
-\\ +
-The following command is used to test a https domain. -k will skip the certificate check +
-<sxh bash> +
-curl -Ik -X GET https://website.com +
-</sxh> +
-\\ +
-**__Testing a vhost on the localhost__** +
-<sxh bash> +
-curl -Iv -x GET localhost -H 'Host: vhost.com' +
-</sxh> +
-\\ +
-**__Body String Match__** +
--s flag hides the download speed etc +
-<sxh bash> +
-curl -is https://tickets.daysoutwithkids.co.uk/longleat | grep Maintenance +
-</sxh> +
-Output: +
-<sxh bash> +
-<title>Days Out With Kids | Maintenance</title> +
-                                    <h3>Sorry, Site Under Maintenance</h3> +
-</sxh> +
-Example without the s flag +
-<sxh bash> +
-curl -i https://tickets.daysoutwithkids.co.uk/longleat | grep Maintenance  +
-</sxh> +
-Output: +
-<sxh bash> +
-  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current +
-                                 Dload  Upload   Total   Spent    Left  Speed +
-100  9885  100  9885    0     0   280k      0 --:--:-- --:--:-- --:--:-- 9653k +
-        <title>Days Out With Kids | Maintenance</title> +
-                                    <h3>Sorry, Site Under Maintenance</h3> +
-</sxh> +
- +
- +
- +
-Testing to see if a website returns a certain string. Body match strings are often used in monitoring alerts +
-<sxh bash> +
-lynx -dump http://lukeslinuxlessons.co.uk | grep 'string match' +
-</sxh> +
- +
-If the website has an ssl certificate you can also apply the 'k' option to bypass the certificate check. e.g: +
-<sxh bash> +
-curl -ik https://website.com | grep body_match_string +
-</sxh>+
http_headers.1441701869.txt.gz · Last modified: (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki