recap http request response
play

Recap: HTTP request/response HTTP request - PowerPoint PPT Presentation

Recap: HTTP request/response HTTP request http://red1.cs.panam.edu/~etomai/links/first.html Hostname is resolved to IP address (e.g. 129.113.132.218) Request type is GET or POST Client Server Request headers give information about


  1. Recap: HTTP request/response HTTP request http://red1.cs.panam.edu/~etomai/links/first.html • Hostname is resolved to IP address (e.g. 129.113.132.218) • Request type is GET or POST Client Server • Request headers give information about the agent • Additional data may be sent • Variable/value pairs in a query string • first.html?name=emmett&number=7 • POSTed in the body from an HTML form

  2. Recap: HTTP request/response HTTP request http://red1.cs.panam.edu/~etomai/links/first.html HTTP response • If the request specifies a static file • HTML, image, video, text, etc… Client Server • The file is retrieved from the server filesystem • Response headers specify type of data • Using MIME types (e.g. text/html) • The file contents are streamed (printed) back to the client

  3. Recap: HTTP request/response HTTP request http://red1.cs.panam.edu/~etomai/links/first.html HTTP response • If the request specifies a CGI script • An executable program Client Server • The program is executed on the server • Request headers and the URL are made available to the program • All output from the program to stdout (cout) is sent back to the client • Should include HTTP response headers

  4. Problems with CGI • Too much work – Unpacking and verifying the data is tedious • Tedious leads to sloppiness - bugs, security risks • Tedious code is hard to maintain – Using << to generate HTML stinks • Better solutions? – Create libraries for common data-handling tasks – Put static HTML in separate files and read them in

  5. Server-side scripting • One of many solutions • “scripting” usually means lightweight, simple – Emphasis on ease of development – Not intended for high-performance applications – Not intended for large-scale code organization • Server-side scripting languages – Java Server Pages (JSP), Active Server Pages (ASP.NET), PHP Hypertext Preprocessor (PHP) – Executed on the server, like CGI programs – Allow a mixture of static and dynamic content • Code fragments are embedded in static HTML

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend