5 Mart 2015 Perşembe

Örnek HTTP/1.0 request ve response mesajları

get /test.html HTTP/1.0

GET metodu yanlışlıkla get olarak yazılıp gönderiliyor.

HTTP/1.1 501 Method Not Implemented
Date: Sun, 18 Oct 2009 10:32:05 GMT
Server: Apache/2.2.14 (Win32)
Allow: GET,HEAD,POST,OPTIONS,TRACE
Content-Length: 215
Connection: close
Content-Type: text/html; charset=iso-8859-1
   
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>501 Method Not Implemented</title>
</head><body>
<h1>Method Not Implemented</h1>
<p>get to /index.html not supported.<br />
</p>
</body></html>

Server bu isteğe 501 hatası ile cevap veriyor.



GET /ndex.html HTTP/1.0

Servera index.html dosyası yerine ndex.html yazıyor. Serverda da böyle bir dosya bulunmuyor.

HTTP/1.1 404 Not Found
Date: Sun, 18 Oct 2009 10:36:20 GMT
Server: Apache/2.2.14 (Win32)
Content-Length: 204
Connection: close
Content-Type: text/html; charset=iso-8859-1
   
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /t.html was not found on this server.</p>
</body></html>

Server bu isteğe 404 kaynak bulunamadı hatası ile cevap veriyor.



GET /index.html HTTTTTP/1.0

Burada HTTP versiyonu hatalı yazılıyor.

HTTP/1.1 400 Bad Request
Date: Sun, 08 Feb 2004 01:29:40 GMT
Server: Apache/1.3.29 (Win32)
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>400 Bad Request</TITLE>
</HEAD><BODY>
<H1>Bad Request</H1>
Your browser sent a request that this server could not understand.<P>
The request line contained invalid characters following the protocol string.<P><P>
</BODY></HTML>
Server bu isteğe 400 hatalı istek cevabı veriyor.
Not: Apachenin yeni sürümlerinde bu hata gözardı ediliyor ve 200 OK cevabı geliyor.



GET test.html HTTP/1.0

Burada istenilen dosyanın başına root ta bulunduğunu gösteren / karakteri koymayı unutuluyor.

HTTP/1.1 400 Bad Request
Date: Sun, 18 Oct 2009 10:42:27 GMT
Server: Apache/2.2.14 (Win32)
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1
   
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
</body></html>

Server buna 400 hatalı istek cevabı veriyor.



GET /test.html HTTP/1.0
Connection: Keep-Alive

Burada serverdan keep-alive isteğinde bulunuluyor. Server kabul ederse tcp bağlantısı hemen kapanmayıp, client aynı bağlantıyı kullanarak başka istekler de gönderebilecek.

HTTP/1.1 200 OK
Date: Sun, 18 Oct 2009 10:47:06 GMT
Server: Apache/2.2.14 (Win32)
Last-Modified: Sat, 20 Nov 2004 07:16:26 GMT
ETag: "10000000565a5-2c-3e94b66c2e680"
Accept-Ranges: bytes
Content-Length: 44
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html
   
<html><body><h1>It works!</h1></body></html>


Server bu isteğe 200 OK cevabı veriyor.
Cevap mesajında ayrıca Keep-alive timeout'u 5 sefer, maksimum istek sayısı da 100 olarak belirleniyor.



<Directory "C:/apache/htdocs/forbidden">
   Order deny,allow
   deny from all
</Directory>

Server configuration dosyasında (httpd.conf) htdocs\forbidden klasörüne tüm girişler engelleniyor.

GET /forbidden/index.html HTTP/1.0
(blank line)
Bir client bu klasör içinden bir dosyaya erişmek istiyor.

HTTP/1.1 403 Forbidden
Date: Sun, 18 Oct 2009 11:58:41 GMT
Server: Apache/2.2.14 (Win32)
Content-Length: 222
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1
   
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /forbidden/index.html
on this server.</p>
</body></html>

Server 403 forbidden yani "giriş yasak" cevabı veriyor.



























Hiç yorum yok:

Yorum Gönder