HTTP Traffic by Telnet

This is just to show the traffic when requesting and submiting a minimum web form by telnet. Command used: c:\ telnet 80, which is our AWS dev server.
There are two round trip traffic. Frist, clent requests a user name password form, second, client submit this form. Server set a cookie when sending out the form. “Access-Control-Allow-Origin *” is important for our streaming server since this allows the web server containing the video player to play the content. Headers are terminated by the sequence \r\n\r\n, then content length is said in header.
The traffic is listed below, excluding commends after # sign.
Client sends #1 to request form:

Host: #nginx requires domain name on the line of GET and HOST
Connection: keep-alive #server doesn’t close this connection, and client reuses this socket.
Cache-Control: max-age=0 #must re-fetch
Upgrade-Insecure-Requests: 1 #please redirect me to a secure representation of the resource
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36 #Chrome UA string
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate # I understand compressed content.
Accept-Language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7 # I understand these languages
# hit return on keyboard twice

Server sends #1 returning the form:

HTTP/1.1 200 OK
Server: nginx/1.9.15
Date: Sat, 14 Jul 2018 22:07:49 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 216
Connection: keep-alive
Set-Cookie: LoginForm=SentAlready #sends client a cookie
Access-Control-Allow-Origin: * #allow pages originated from other web sites to fetch this content
<form action=”/test” method=”post”> #just a minimum web form
Username: <input name=”username” type=”text” value=”a”/>
Password: <input name=”password” type=”password” value=”a”/>
<input value=”Login” type=”submit” />

Client sends #2 to submitting the form:

POST HTTP/1.1 #post the form
Connection: keep-alive
Content-Length: 21
Cache-Control: max-age=0
Origin: #the web server that generated this page.
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: # same as last request
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Referer: #previous web page
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7
Cookie: LoginForm=SentAlready #the cookie set by last server response.
# hit return on keyboard twice

Server sends #2 saying form submitted successfully:

HTTP/1.1 200 OK
Server: nginx/1.9.15
Date: Sat, 14 Jul 2018 22:07:51 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 23
Connection: keep-alive
Cache-Control: no-cache

Comments are closed.
%d bloggers like this: