Question: In C# write a simple HTTP image browser; i.e. , a Windows forms app which, like an ordinary Web browser, allows users to enter a
In C# write a simple HTTP image browser; i.e., a Windows forms app which, like an ordinary Web browser, allows users to enter a URL in a textbox at the top of the window, makes an HTTP request for the resource located at the URL and which, if the URL references an image file; e.g., *.jpg, *.gif, *.png, etc., displays the retrieved image in the browser's Image window.
However, this browser should not only display the image, it should also, in a small window above the image, display the HTTP response line and all HTTP headers received from the server serving the HTTP request. For instance, an HTTP request for http://classes.bus.oregonstate.edu/ba371/reitsma/images/cob.png, results in the following response line and headers being returned by COB's Web server:
HTTP/1.1 200 OK Content-Type: image/png Last-Modified: Wed, 22 Nov 2017 21:46:08 GMT Accept-Ranges: bytes ETag: "a7b8794edb63d31:0" Server: Microsoft-IIS/8.0 X-Powered-By: ASP.NET Date: Mon, 19 Mar 2018 23:39:02 GMT Content-Length: 59587 Length: 59587 (58K) [image/png]
In addition, we want to distinguish the HTTP response status from the headers and display it in a separate Status code textbox (see example above).
Simple HTTP Image Browser Browser Image URL: http// Hlasses bus. oregonstate.edu/ba371/reitsma/mages/cob png Status Code: 200: OK Headers:Connection:close Go Accept-Ranges: bytes Content-Length: 59587 Content-Type: image/png Date: Mon, 19 Mar 2018 23:32:04 GMT ETag: "a7b8794edb 63d31:0" Last-Modified: Wed, 22 Nov 2017 21:46:08 GMT
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
