Question: Exercise 101: The students create a client program that can manually fetch Web contents over HTTP. Concretely, this program enables to (1) send the HTTP

Exercise 101: The students create a clientExercise 101: The students create a clientExercise 101: The students create a clientExercise 101: The students create a client

Exercise 101: The students create a client program that can manually fetch Web contents over HTTP. Concretely, this program enables to (1) send the HTTP request contained in a specified input file (e.g., http_req.txt) to a Web server and then output the HTTP response from the server to another file (e.g., http_res.txt). Lists 10-3 through 10-5 show the execution example of Exercise 10-1 (e.g., WebClient.java). List 10-3. Input file containing HTTP request (e.g., http_req.txt). http_req.txt Note: two blank 1 2 3 4 GET / HTTP/1.1 Host: www.gin.ics.ritsumei.ac.jp lines are needed! List 10-4. Execution example of a client program (e.g., WebClient.java). % java Webclient www.gin.ics.ritsumei.ac.jp http_req.txt http_res.txt 80 Connected to server sending echo string GET / HTTP/1.1 Host: www.gin.ics.ritsumei.ac.jp Targeted Web server Received: HTTP/1.1 200 OK Date: Tue, 26 Nov 2019 11:22:32 GMT Server: Apache/2.4.41 (FreeBSD) Accept-Ranges: bytes Transfer-Encoding: chunked Content-Type: text/html 19a Nishimura laboratory, Ritsumeikan University : 0 ALT="Holizontal line (rule)" height=22 width=468>

Links

Department of Information & Communication Science Received: 3476 bytes List 10-5. Output file containing HTTP response (e.g., http_res.txt). % cat http_res.txt HTTP/1.1 200 OK Date: Tue, 26 Nov 2019 11:29:54 GMT Server: Apache/2.4.41 (FreeBSD) Accept-Ranges: bytes Transfer-Encoding: chunked Content-Type: text/html 19a Nishimura laboratory, Ritsumeikan University : : : 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!