Skip to content

Instantly share code, notes, and snippets.

@hookbil
Last active October 10, 2018 11:39
Show Gist options
  • Select an option

  • Save hookbil/9dffbbb3e00a20ea9c4fa6ef68f1a516 to your computer and use it in GitHub Desktop.

Select an option

Save hookbil/9dffbbb3e00a20ea9c4fa6ef68f1a516 to your computer and use it in GitHub Desktop.
- Пустой get запрос:
netcat -C httpbin.org 80
GET / HTTP/1.1
Host: httpbin.org
HTTP/1.1 200 OK
Connection: keep-alive
Server: gunicorn/19.9.0
Date: Tue, 09 Oct 2018 12:15:21 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 10122
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Via: 1.1 vegur
....
- Get запрос с параметром строки
netcat -C httpbin.org 80
GET /get?login=hookbil&lang=ru HTTP/1.1
Host: httpbin.org
HTTP/1.1 200 OK
Connection: keep-alive
Server: gunicorn/19.9.0
Date: Wed, 10 Oct 2018 11:38:40 GMT
Content-Type: application/json
Content-Length: 223
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Via: 1.1 vegur
{
"args": {
"lang": "ru",
"login": "hookbil"
},
"headers": {
"Connection": "close",
"Host": "httpbin.org"
},
"origin": "89.223.31.4",
"url": "http://httpbin.org/get?login=hookbil&lang=ru"
}
-Post запрос
netcat -C httpbin.org 80
POST /post HTTP/1.1
Host: httpbin.org
Content-Type: application/json
Content-Length: 30
{"id": 001, "name": "hookbil"}
HTTP/1.1 200 OK
Connection: keep-alive
Server: gunicorn/19.9.0
Date: Wed, 10 Oct 2018 09:49:38 GMT
Content-Type: application/json
Content-Length: 326
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Via: 1.1 vegur
{
"args": {},
"data": "{\"id\": 001, \"name\": \"hookbil\"}",
"files": {},
"form": {},
"headers": {
"Connection": "close",
"Content-Length": "30",
"Content-Type": "application/json",
"Host": "httpbin.org"
},
"json": null,
"origin": "86.62.69.82",
"url": "http://httpbin.org/post"
}
@psylone

psylone commented Oct 9, 2018

Copy link
Copy Markdown

https://gist.github.com/hookbil/9dffbbb3e00a20ea9c4fa6ef68f1a516#file-lesson_1-L77 здесь должен быть успешный статус ответа. И лучше передать какие-то данные, вместо символов пустой строки и возврата каретки.

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