Last active
October 10, 2018 11:39
-
-
Save hookbil/9dffbbb3e00a20ea9c4fa6ef68f1a516 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| - Пустой 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" | |
| } | |
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
https://gist.github.com/hookbil/9dffbbb3e00a20ea9c4fa6ef68f1a516#file-lesson_1-L20 где же параметры?