Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AlucardYanas/1c32039fb8144899e347561638559fb7 to your computer and use it in GitHub Desktop.
Save AlucardYanas/1c32039fb8144899e347561638559fb7 to your computer and use it in GitHub Desktop.
Задание к уроку "Архитектура клиент-сервер и HTTP ghjnjrjk@
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"
}
@psylone
Copy link

psylone commented Mar 17, 2019

Обрати внимание, у тебя здесь опечатка: https://gist.github.com/AlucardYanas/1c32039fb8144899e347561638559fb7#file-gistfile1-txt-L71

@psylone
Copy link

psylone commented Mar 17, 2019

Между последним заголовком и телом запроса должна быть пустая строка. Ты можешь проверить что данные тела запроса отправились успешно по ответу, эти данные должны быть в поле data, у тебя там пустая строка.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment