Write a client program which invokes Form.cgi with POST method specified, using either the stream socket API or the URL class.

Hand in the program listings.

The data that needs to be exchanged is shown below:
```
>telnet www 80
Trying 129.65.241.7...
Connected to tiedye-srv.csc.calpoly.edu.
Escape character is '^]'.
POST /~mliu/form/postForm.cgi HTTP/1.0
Content-type: application/x-www-form-urlencoded
Content-length: 11

name=Donald
HTTP/1.1 200 OK
Date: Sun, 24 Feb 2002 22:52:33 GMT
Server: Apache/1.3.9 (Unix) ApacheJServ/1.0
Connection: close
Content-Type: text/html

Query Results

You submitted the following name/v
alue pairs:



  • name = Donald
    Connection closed by foreign host.
    ```

    ```
    //HTTPClient
    try {
    String query = "name=Donald%20Duck&quest=gold%20medal";
    InetAddress host =
    InetAddress.getByName("www.csc.calpoly.edu");
    int port = 80;
    String fileName = "/~mliu/form/postForm.cgi";
    String request =
    "POST " + fileName + " HTTP/1.0\n" +
    "Content-type: application/x-www-form-urlencoded\n"+
    "Content-length: " + query.length( ) +"\n\n" +
    query;
    MyStreamSocket mySocket =
    new MyStreamSocket(host, port);
    /**/ System.out.println("Connection
    ```

    Computer Science & Information Technology

You might also like to view...

Dynamic IP addresses are provided to a computer when it needs to be connected to the network. The provider is the DHCP server. When the computer is disconnected, the IP address becomes available for use by another computer. The address does not become available immediately, however. It is leased for a specific period of time, and when the lease is up, the IP address is placed back in an IP

address pool and can be delivered to another computer. Indicate whether the statement is true or false

Computer Science & Information Technology

What security system allows system boot to be disabled if the computer is reported stolen?

A. BoJackson B. LoJake C. BitLocker D. LoJack

Computer Science & Information Technology