Last active
March 16, 2016 10:34
-
-
Save KhorAMus/b15f96b784fa4663a3fd to your computer and use it in GitHub Desktop.
Exercise 1.3 и 1.4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 запрос/ответ | |
telnet httpbin.org 80 | |
Trying 54.175.219.8... | |
Connected to httpbin.org. | |
Escape character is '^]'. | |
GET /ip HTTP/1.1 | |
Host: httpbin.org | |
Accept: */* | |
HTTP/1.1 200 OK | |
Server: nginx | |
Date: Mon, 29 Feb 2016 05:26:09 GMT | |
Content-Type: application/json | |
Content-Length: 31 | |
Connection: keep-alive | |
Access-Control-Allow-Origin: * | |
Access-Control-Allow-Credentials: true | |
{ | |
"origin": "5.166.37.104" | |
} | |
2 запрос/ответ | |
GET /get?foo=bar&1=2&2/0&error=True HTTP/1.1 | |
Host: httpbin.org | |
Accept: */* | |
HTTP/1.1 200 OK | |
Server: nginx | |
Date: Fri, 11 Mar 2016 15:49:04 GMT | |
Content-Type: application/json | |
Content-Length: 254 | |
Connection: keep-alive | |
Access-Control-Allow-Origin: * | |
Access-Control-Allow-Credentials: true | |
{ | |
"args": { | |
"1": "2", | |
"2/0": "", | |
"error": "True", | |
"foo": "bar" | |
}, | |
"headers": { | |
"Accept": "*/*", | |
"Host": "httpbin.org" | |
}, | |
"origin": "5.167.225.169", | |
"url": "http://httpbin.org/get?foo=bar&1=2&2%2F0&error=True" | |
} | |
3 запрос/ответ | |
POST /post HTTP/1.1 | |
Host: httpbin.org | |
Accept: */* | |
Content-Length: 35 | |
Content-Type: application/x-www-form-urlencoded | |
foo=bar&1=2&2%2F0=&error=True | |
HTTP/1.1 200 OK | |
Server: nginx | |
Date: Sat, 12 Mar 2016 05:16:49 GMT | |
Content-Type: application/json | |
Content-Length: 388 | |
Connection: keep-alive | |
Access-Control-Allow-Origin: * | |
Access-Control-Allow-Credentials: true | |
{ | |
"args": {}, | |
"data": "", | |
"files": {}, | |
"form": { | |
"1": "2", | |
"2/0": "", | |
"error": "True\r\n\r\n\r\n", | |
"foo": "bar" | |
}, | |
"headers": { | |
"Accept": "*/*", | |
"Content-Length": "35", | |
"Content-Type": "application/x-www-form-urlencoded", | |
"Host": "httpbin.org" | |
}, | |
"json": null, | |
"origin": "188.234.86.20", | |
"url": "http://httpbin.org/post" | |
} | |
4 запрос/ответ | |
telnet httpbin.org 80 | |
Trying 54.175.219.8... | |
Connected to httpbin.org. | |
Escape character is '^]'. | |
GET /cookies/set?country=Ru HTTP/1.1 | |
Host: httpbin.org | |
Accept: */* | |
HTTP/1.1 302 FOUND | |
Server: nginx | |
Date: Sat, 12 Mar 2016 05:41:24 GMT | |
Content-Type: text/html; charset=utf-8 | |
Content-Length: 223 | |
Connection: keep-alive | |
Location: /cookies | |
Set-Cookie: country=Ru; Path=/ | |
Access-Control-Allow-Origin: * | |
Access-Control-Allow-Credentials: true | |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> | |
<title>Redirecting...</title> | |
<h1>Redirecting...</h1> | |
<p>You should be redirected automatically to target URL: <a href="/cookies">/cookies</a>. If not click the link.Connection closed by foreign host. | |
5 запрос/ответ | |
GET /cookies HTTP/1.1 | |
Host: httpbin.org | |
Accept: */* | |
HTTP/1.1 200 OK | |
Server: nginx | |
Date: Sat, 12 Mar 2016 05:56:59 GMT | |
Content-Type: application/json | |
Content-Length: 20 | |
Connection: keep-alive | |
Access-Control-Allow-Origin: * | |
Access-Control-Allow-Credentials: true | |
{ | |
"cookies": {} | |
} | |
6 запрос/ответ | |
GET /redirect/4 HTTP/1.1 | |
Host: httpbin.org | |
Accept: */* | |
HTTP/1.1 302 FOUND | |
Server: nginx | |
Date: Sun, 13 Mar 2016 11:43:04 GMT | |
Content-Type: text/html; charset=utf-8 | |
Content-Length: 247 | |
Connection: keep-alive | |
Location: /relative-redirect/3 | |
Access-Control-Allow-Origin: * | |
Access-Control-Allow-Credentials: true | |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> | |
<title>Redirecting...</title> | |
<h1>Redirecting...</h1> | |
<p>You should be redirected automatically to target URL: <a href="/relative-redirect/3">/relative-redirect/3</a>. If not click the link. | |
Connection closed by foreign host. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Отправляем запрос. Первой строкой указываем, что мы хотим получить страницy /ip и что общение ведётся по протоколу версии 1.1. | |
Второй строкой указываем URI без слэшей, который определяет ip-адрес серевера к которому мы обращаемся. | |
Далее указываем, то что нам подойдут все форматы. | |
Получаем ответ. Первой строкой указывается состояние 200. Это значит, что запрос/ответ произошёл успешно и выдалась | |
информация в соответствии с указанным методом. В поле Content-Type можем заметить, что ответ получен не в формате HTML, | |
а в формате application/json. | |
После всех заголовков видим, что указанная страница действительно хранит не HTML, а JSON. | |
Во втором запросе в поле с методом GET указываем, что мы хотим получить страницу get, | |
при этом передать аргументы foo=bar, 1=2, 2/0=""(аргумент равен пустой строке), error=True | |
В ответе получаем страницу в формате JSON с указанием того какие аргументы и с какими значениями мы передали. | |
В третьем запросе вместо метода GET указываем POST, поэтому аргументы передаём после всех | |
заголовков, в теле сообщения. | |
В четвёртом запросе запрашиваем страницу /cookies/set с аргументом country=Ru | |
Эта страница предназначена для проверки установки cookie. | |
В ответе получаем код состояния 302. Это означает, что сервер нас просит перенаправится на другую страницу. | |
Эта другая страница предназначена для отображения, сохранившихся на клиенте, cookies, связанных с этим сервером. | |
В пятом запросе хотим получить страницу, на которую сервер нам предлагал перенаправиться. | |
В JSON-файле, присланным сервером видим, что у нас нет cookie. Это потому что telnet не умеет сохранять cookie. | |
В шестом запросе хотим получить страницу /redirect/4. Эта страница специально предназначена для проверки редиректа. | |
В ответе от сервера видим код состояния 302, который и означает, что нам нужно перенаправится на другую страницу, а | |
именно на /relative-redirect/3, указанную в заголовке Location. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Exercise 1.4</title> | |
</head> | |
<body> | |
<form action="http://httpbin.org/post" method="post" enctype="multipart/form-data"> | |
<p>Firstname: <input type="text" name="firstname"><br /> | |
Lastname: <input type="text" name="lastname" /><br /> | |
Group: <input type="text" name="group" /><br /> | |
Message:<input type="text" name="message" /><br /> | |
Avatar:<input type="file" name="myimg" /><br /></p> | |
<p><input type="submit" /></p> | |
</form> | |
</body> | |
</html> | |
Отправляем следующие данные: | |
Firstname: Альберт | |
Lastname: Хорошун | |
Group: ФО-331003 | |
Message: ☺ | |
Avatar: factory_layout.png | |
Результат отправки данных формы: | |
{ | |
"args": {}, | |
"data": "", | |
"files": { | |
"myimg": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAiwAAACcCAIAAADTQGfiAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAdnUlEQVR4nO2d+1vURhfH3z/5pdraVtu34rXWqouoINZLFfFCVVC0eMX7IiBXuXRvwLLL4iLgAj/3PWwkhiTkJLvJZGbznecjT5ydyc6cZM53J5mc/OdfJCQkJCSkkNJ/6F8PEhISEhKS8AQRQkJCQkIKLUGEkJCQkJBCSxAhJCQkJKTQko0Ira8WVEHFNgMA1g2DF+N3PXrWMPYXIgQACAFFfU5ARM0axv5ChAAAIaCozwmIqFnD2F+IEAAgBBT1OQERNWsY+wsRAgCEgKI+JyCiZg1jfyFCAIAQUNTnBETUrGHsL0QIABACivqcgIiaNYz9hQgBAEJAUZ8TEFGzhrG/ECEAQAgo6nMCImrWMPYXIgQACAFFfU5ARM0axv5ChAAAIaCozwmIqFnD2F+IEAAgBBT1OQERNWsY+6uACKUmXynHdLI3mxmYmx5cyI0Tn4rJ5cXMytIM21kAIoLMPkc8UbOGsb8QIaGkp17nZoaKhanVlTm24wDUMDL7HPFEzR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zv+uHI1MfFSkxYq2fV3x476Bu1anzEmUEQux32z92uAS9tglyLZf+KPD5Mj1IZ8Pn2o8aIeY2ZsfKRQmP52/0n6VHssP9x2AqWBCAEeqxMnFfnx19PfHdgSA9uoEy6j9Zhi9vTGHx1uPKe9o6hua0ygiFyOI4cuz0zIeDGQZjy28crWLeFqAPCEjQgZs9j6IArY+vFyJJ6tOeYCfLQea8yezXxzTKDkVmyb5B62y2Fx6uJ17RWZA8PvG863hXtP6EDs/MzsP7QxP58+eeGa9UVqECFQPRAhwMP6dOVguxwW79737Tp4mtz6j4dP94cddHJ8avRQ48Wd+2Kxc63WaJsQIeALECHAw/p05WC7HCJSBZ10iLZpGz0TAK9AhAAP69OVg+1y6Px5s4MtIx45WwWUBiIEeFifrhxsl0Pnv7+cYMuIR85WAaWBCAEe1qcrB9vl0JHT3cvZKqA0ECHAw/p05WC7HC6fFmfJ3Xd2P7blVlf3rfvd4j8lIELAdyBCgIf16crBdjlcNHfvwN5jLdvpxC/HWoKrCxECvgMRAjysT1cOtsvhwopQ7NzV7erSR8HVhQgB34EIAR7WpysH2+VwYUWomtlMNXUhQsB3IEKAh/XpysF2OVySqYnvD53aTipab927euuu+E+Jn482s40HwBMQIcDD+nTlYLsMABADRAjwsD5dOdguAwDEABECPKxPVw62ywAAMUCEAA/r05WD7TIAQAwQIQAAAKEBEQIAABAaECEAAAChwYgQkrqJPfYVw30zEhISUiUJIlRTidWSiuG+GQkJCamSBBGqqfRvYIn7ZiQkJKRK0r8QoVpKnJRUnrhvRkJCQqok/auJEBISEhISUijp/9sHbzwpa7rPAAAAAElFTkSuQmCC" | |
}, | |
"form": { | |
"firstname": "\u0410\u043b\u044c\u0431\u0435\u0440\u0442", | |
"group": "\u0424\u041e-331003", | |
"lastname": "\u0425\u043e\u0440\u043e\u0448\u0443\u043d", | |
"message": "\u263a" | |
}, | |
"headers": { | |
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", | |
"Accept-Encoding": "gzip, deflate", | |
"Accept-Language": "ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4", | |
"Cache-Control": "max-age=0", | |
"Content-Length": "8288", | |
"Content-Type": "multipart/form-data; boundary=----WebKitFormBoundaryx4WQftNR2JuflQyu", | |
"Forwarded": "for=5.166.52.24", | |
"Host": "httpbin.org", | |
"Origin": "null", | |
"Scheme": "http", | |
"Upgrade-Insecure-Requests": "1", | |
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36", | |
"Via": "1.1 Chrome-Compression-Proxy" | |
}, | |
"json": null, | |
"origin": "5.166.52.24, 66.102.9.84", | |
"url": "http://httpbin.org/post" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Форма успешно была создана. После заполнения формы и нажатия кнопки, браузер | |
отправил POST-запрос с данными на httpbin.org, введёнными на странице. При этом в нашем HTML-коде мы указали, что хотим | |
воспользоваться http://httpbin.org/post | |
для обработки данных формы. | |
В ответе можем видеть в поле "file" информацию, | |
содержащуюся в нашей картинке, декодированную как текст. | |
В поле form видно какие мы данные отправили, но эти данные представлены как коды символов Unicode. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment