Created
March 16, 2019 22:21
-
-
Save AlucardYanas/1c32039fb8144899e347561638559fb7 to your computer and use it in GitHub Desktop.
Задание к уроку "Архитектура клиент-сервер и HTTP ghjnjrjk@
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
MacBook-Air-Artem:~ alucard_yanas$ ncat -C httpbin.org 80 | |
GET /anything?arg1=25 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: Thu, 14 Mar 2019 14:23:27 GMT | |
Server: nginx | |
Content-Length: 262 | |
Connection: keep-alive | |
{ | |
"args": { | |
"arg1": "25" | |
}, | |
"data": "", | |
"files": {}, | |
"form": {}, | |
"headers": { | |
"Host": "httpbin.org" | |
}, | |
"json": null, | |
"method": "GET", | |
"origin": "95.131.180.90, 95.131.180.90", | |
"url": "https://httpbin.org/anything?arg1=25" | |
} | |
MacBook-Air-Artem:~ alucard_yanas$ 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: Sat, 16 Mar 2019 19:53:54 GMT | |
Server: nginx | |
Content-Length: 236 | |
Connection: keep-alive | |
{ | |
"args": {}, | |
"data": "", | |
"files": {}, | |
"form": {}, | |
"headers": { | |
"Host": "httpbin.org" | |
}, | |
"json": null, | |
"method": "GET", | |
"origin": "46.188.122.127, 46.188.122.127", | |
"url": "https://httpbin.org/anything" | |
} | |
acBook-Air-Artem:~ alucard_yanas$ ncat -C httpbin.org 80 | |
POST /anything?arg1=50 HTTP/1.1 | |
Host: httpbin.org | |
Content-Length: 5 | |
12345 | |
HTTP/1.1 400 BAD_REQUEST | |
Content-Length: 0 | |
Connection: Close | |
^Z | |
[8]+ Stopped ncat -C httpbin.org 80 | |
MacBook-Air-Artem:~ alucard_yanas$ ncat -C httpbin.org 80 | |
POST /anything HTTP/1.1 | |
HOST: httpbin.org | |
Contetn-Length: 5 | |
12345 | |
HTTP/1.1 200 OK | |
Access-Control-Allow-Credentials: true | |
Access-Control-Allow-Origin: * | |
Content-Type: application/json | |
Date: Sat, 16 Mar 2019 21:49:27 GMT | |
Server: nginx | |
Content-Length: 293 | |
Connection: keep-alive | |
{ | |
"args": {}, | |
"data": "", | |
"files": {}, | |
"form": {}, | |
"headers": { | |
"Content-Length": "0", | |
"Contetn-Length": "5", | |
"Host": "httpbin.org" | |
}, | |
"json": null, | |
"method": "POST", | |
"origin": "46.188.122.127, 46.188.122.127", | |
"url": "https://httpbin.org/anything" | |
} |
Между последним заголовком и телом запроса должна быть пустая строка. Ты можешь проверить что данные тела запроса отправились успешно по ответу, эти данные должны быть в поле data
, у тебя там пустая строка.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Обрати внимание, у тебя здесь опечатка: https://gist.github.com/AlucardYanas/1c32039fb8144899e347561638559fb7#file-gistfile1-txt-L71