Telnet and HTTP

Source: Internet
Author: User

Run the CMD command to enter

Telnet localhost 8080 press ENTER

// First write the following two lines, paste them to the command line, paste the content above is invisible, and then press ENTER twice to get the result.

Post/test/login. jsp HTTP/1.1

HOST: localhost press enter (two press returns)


The result is as follows:
(The following is a self-written JSP page, which is displayed in the POST method)
HTTP/1.1 200 OK
Server: APACHE-Coyote/1.1
Set-COOKIE: JSESSIONID = 00cfcba663892ec713fd9bdb7a02ba32; Path =/test/; HTTPOnly
Content-Type: text/html; charset = UTF-8
Content-Length: 867
Date: Wed, 18 Apr 2012 14:07:54 GMT

<! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en">
<HTML>
<Head>
<Base href = "http: // localhost: 80/test/">

<Title> my JSP 'login. jsp 'starting page </title>

<Meta http-equiv = "Pragma" content = "no-Cache">
<Meta http-equiv = "cache-control" content = "no-Cache">
<Meta http-equiv = "expires" content = "0">
<Meta http-equiv = "keywords" content = "keyword1, keyword2, keyword3">
<Meta http-equiv = "Description" content = "this is my page">
<! --
<LINK rel = "stylesheet" type = "text/CSS" href = "styles.css">
-->

</Head>

<Body>

<Form action = "login" method = "Post">

Username: <input type = "username" name = "username"> <br>
Password: <input type = "password" name = "password"> <br>
<Input type = "Submit" value = "Submit"> & nbsp;
<Input type = "reset" value = "reset"> <br>

</Form>

</Body>
</Html>

**************************************** **************************************** **************************************** ********

// Login is the value of URL-pattern in Web. xml.

Telnet localhost 8080 press ENTER

GET/test/login HTTP/1.1

HOST: localhost press ENTER

(The result is omitted ...)


Telnet www.sina.com.cn and press ENTER
GET/index.html HTTP/1.1

HOST: www.sina.com.cn press ENTER

(The result is omitted ...)


Head/index.html HTTP/1.1 press ENTER

HOST: www.sina.com.cn press enter (two press returns)

(The result is omitted ...)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.