Skip to content

Instantly share code, notes, and snippets.

@aritode
Created October 5, 2018 21:45
Show Gist options
  • Select an option

  • Save aritode/729bcec192e9f23026aab18a07cf5bb0 to your computer and use it in GitHub Desktop.

Select an option

Save aritode/729bcec192e9f23026aab18a07cf5bb0 to your computer and use it in GitHub Desktop.
HTTP REQUESTS - http://httpbin.org/anything

1. Сформируйте и отправьте по указанному выше url:

1.1 GET запрос без параметров

~|⇒  ncat -C httpbin.org 80
 
GET /anything HTTP/1.1
Host: httpbin.org
HTTP/1.1 200 OK
Connection: keep-alive
Server: gunicorn/19.9.0
Date: Fri, 05 Oct 2018 20:38:41 GMT
Content-Type: application/json
Content-Length: 246
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Via: 1.1 vegur

{
  "args": {},
  "data": "",
  "files": {},
  "form": {},
  "headers": {
    "Connection": "close",
    "Host": "httpbin.org"
  },
  "json": null,
  "method": "GET",
  "origin": "***.***.***.***",
  "url": "http://httpbin.org/anything"
}

1.2 GET запрос с любыми параметрами строки URL

~|⇒  ncat -C httpbin.org 80
 
 GET /anything?name=origin HTTP/1.1
 Host: httpbin.org
HTTP/1.1 200 OK
Connection: keep-alive
Server: gunicorn/19.9.0
Date: Fri, 05 Oct 2018 20:49:03 GMT
Content-Type: application/json
Content-Length: 282
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Via: 1.1 vegur

{
  "args": {
    "name": "origin"
  },
  "data": "",
  "files": {},
  "form": {},
  "headers": {
    "Connection": "close",
    "Host": "httpbin.org"
  },
  "json": null,
  "method": "GET",
  "origin": "***.***.***.***",
  "url": "http://httpbin.org/anything?name=origin"
}

1.3 POST запрос с любыми параметрами

 ~|⇒  ncat -C httpbin.org 80

POST /anything HTTP/1.1
Host: httpbin.org
Content-length: 29

name=aristotel&message=yoman
HTTP/1.1 200 OK
Connection: keep-alive
Server: gunicorn/19.9.0
Date: Fri, 05 Oct 2018 21:23:14 GMT
Content-Type: application/json
Content-Length: 306
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Via: 1.1 vegur

{
  "args": {},
  "data": "name=aristotel&message=yoman\r",
  "files": {},
  "form": {},
  "headers": {
    "Connection": "close",
    "Content-Length": "29",
    "Host": "httpbin.org"
  },
  "json": null,
  "method": "POST",
  "origin": "***.***.***.***",
  "url": "http://httpbin.org/anything"
}
HTTP/1.1 400 Bad Request
Connection: close
Server: Cowboy
Date: Fri, 05 Oct 2018 21:23:13 GMT
Content-Length: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment