Skip to content

Instantly share code, notes, and snippets.

@shilovk
Last active December 11, 2019 11:41
Show Gist options
  • Select an option

  • Save shilovk/9511ad4bf0fec14f01d0eefdab9cd5e5 to your computer and use it in GitHub Desktop.

Select an option

Save shilovk/9511ad4bf0fec14f01d0eefdab9cd5e5 to your computer and use it in GitHub Desktop.
Задание к уроку "Архитектура клиент-сервер и HTTP-протокол"
Homework 1.4
https://gist.github.com/shilovk/9511ad4bf0fec14f01d0eefdab9cd5e5
1.
ncat -C httpbin.org 80
GET /anything HTTP/1.1
Host: httpbin.org
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Wed, 11 Dec 2019 10:38:12 GMT
Referrer-Policy: no-referrer-when-downgrade
Server: nginx
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Content-Length: 238
Connection: keep-alive
{
"args": {},
"data": "",
"files": {},
"form": {},
"headers": {
"Host": "httpbin.org"
},
"json": null,
"method": "GET",
"origin": "185.153.133.219, 185.153.133.219",
"url": "https://httpbin.org/anything"
}
GET /anything?a=1 HTTP/1.1
Host: httpbin.org
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Wed, 11 Dec 2019 10:38:55 GMT
Referrer-Policy: no-referrer-when-downgrade
Server: nginx
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Content-Length: 258
Connection: keep-alive
{
"args": {
"a": "1"
},
"data": "",
"files": {},
"form": {},
"headers": {
"Host": "httpbin.org"
},
"json": null,
"method": "GET",
"origin": "185.153.133.219, 185.153.133.219",
"url": "https://httpbin.org/anything?a=1"
}
POST /anything HTTP/1.1
Host: httpbin.org
Content-Length: 27
field1=value1&field2=value2
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Wed, 11 Dec 2019 11:40:08 GMT
Referrer-Policy: no-referrer-when-downgrade
Server: nginx
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Content-Length: 289
Connection: keep-alive
{
"args": {},
"data": "field1=value1&field2=value2",
"files": {},
"form": {},
"headers": {
"Content-Length": "27",
"Host": "httpbin.org"
},
"json": null,
"method": "POST",
"origin": "82.102.22.14, 82.102.22.14",
"url": "https://httpbin.org/anything"
}
2.
POST/GET/PUT(PATCH)/DELETE
3.
Accept
Список допустимых форматов ресурса.
Запрос
Cache-Control
Основные директивы для управления кэшированием
Запрос+Ответ
Connection
Сведения о проведении соединения.
Запрос+Ответ
Content-Length
Размер содержимого сущности в байтах
Запрос+Ответ
Content-Type
Формат и способ представления сущности.
Запрос+Ответ
User-Agent
Список названий и версий клиента и его компонентов с комментариями.
Запрос
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment