Skip to content

Instantly share code, notes, and snippets.

@supervoron1
Created September 3, 2019 05:56
Show Gist options
  • Save supervoron1/59169341fb749cf6c57ed6e3495b0469 to your computer and use it in GitHub Desktop.
Save supervoron1/59169341fb749cf6c57ed6e3495b0469 to your computer and use it in GitHub Desktop.
GET and POST methods with/without parameters
dmitry@linuxmint in ~
$ ncat -C httpbin.org 80
GET / HTTP/1.1
Host: httpbin.org
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Content-Type: text/html; charset=utf-8
Date: Tue, 03 Sep 2019 05:11:04 GMT
Referrer-Policy: no-referrer-when-downgrade
Server: nginx
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Content-Length: 9593
Connection: keep-alive
<!DOCTYPE html>
<html lang="en">
.......long html code...........
</html>
dmitry@linuxmint in ~
$ ncat -C httpbin.org 80
GET /anything?level=2 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: Tue, 03 Sep 2019 05:25:21 GMT
Referrer-Policy: no-referrer-when-downgrade
Server: nginx
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Content-Length: 258
Connection: keep-alive
{
"args": {
"level": "2"
},
"data": "",
"files": {},
"form": {},
"headers": {
"Host": "httpbin.org"
},
"json": null,
"method": "GET",
"origin": "31.28.50.27, 31.28.50.27",
"url": "https://httpbin.org/anything?level=2"
}
dmitry@linuxmint in ~
$ ncat -C httpbin.org 80
POST /anything HTTP/1.1
Host: httpbin.org
Content-Length: 32
name1=value1
level=up
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Tue, 03 Sep 2019 05:50:23 GMT
Referrer-Policy: no-referrer-when-downgrade
Server: nginx
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Content-Length: 304
Connection: keep-alive
{
"args": {},
"data": "name1=value1\r\n\r\nlevel=up\r\n\r\n\r\n\r\n",
"files": {},
"form": {},
"headers": {
"Content-Length": "32",
"Host": "httpbin.org"
},
"json": null,
"method": "POST",
"origin": "31.28.50.27, 31.28.50.27",
"url": "https://httpbin.org/anything"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment