Skip to content

Instantly share code, notes, and snippets.

View pirent's full-sized avatar

Phuc Vo pirent

  • AdNovum Vietnam
  • Vietnam
View GitHub Profile
HEAD /home HTTP/1.1
Host: www.abc.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36
// ======================================================== ||
// Sau đó nhận về response với một đống header
// và cái quan trọng nhất ở đây là thông tin về việc nội dung có bị thay đổi
// ======================================================== ||
HTTP/1.1 200 OK
Date: Mon, 07 Nov 2016 15:41:00 GMT
POST /random-name-by-faction HTTP/1.1
HOST: www.pirent-homm3.com
User-Agent: ...
faction=Dungeon
// Request
GET /random-name-by-faction?faction=Dungeon HTTP/1.1
HOST: www.pirent-homm3.com
User-Agent: ...
// =====================================
// Response
HTTP/1.1 200 OK
Date: 10th Nov 2016 10:10:00 GMT
<HTML>
<HEAD>
<TITLE>Random name</TITLE>
</HEAD>
<BODY>
<H1>Enter a faction and get a random creature name</H1>
<FORM action="http://www.pirent-homm3.com/random-name-by-faction" method="get">
Faction: <INPUT name="faction">
<INPUT type="submit" value="creature-name">
</FORM>
HTTP/1.1 200 OK
Content-type: text/html
Content-length: 420
...
<HTML>
<HEAD>
<TITLE>Decepticon home page</TITLE>
</HEAD>
<BODY>
HTTP/version status-code short-description
Header-name-1: value
Header-name-2: value
[response body]
GET /decepticon/index.html HTTP/1.1
Host: www.cybertron.com
@pirent
pirent / http-request-structure
Last active November 6, 2016 13:45
Structure of HTTP request
METHOD /path-to-resource HTTP/<version-number>
Header-name-1: value
Header-name-2: value
[request body]