HTTP. EC512 Spring /15/2015 EC512 - Prof. Thomas Skinner 1

Similar documents
USQ/CSC2406 Web Publishing

Forms, CGI. Objectives

Persistent systems. Traditional software: Data stored outside of program. Program

Forms, CGI. HTML forms. Form example. Form example...

Chapter 1 FORMS. SYS-ED/ Computer Education Techniques, Inc.

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

Web Forms ASP.NET. 2/12/2018 EC512 - Prof. Skinner 1

HTML HTML. Chris Seddon CRS Enterprises Ltd 1

How to Set Up a Custom Challenge Page for Authentication

More Programming Languages. Spring 2014 Carola Wenk

Forms, CGI. Cristian Bogdan 2D2052 / 2D1335 F5 1

First Version Web 1.0: customer.jsp

World Wide Web, etc.

Web forms and CGI scripts

Hypertext Transport Protocol

BIL 104E Introduction to Scientific and Engineering Computing. Lecture 14

Spring 2014 Interim. HTML forms

NET 311 INFORMATION SECURITY

CS105 Perl: Perl CGI. Nathan Clement 24 Feb 2014

Course Topics. The Three-Tier Architecture. Example 1: Airline reservations. IT360: Applied Database Systems. Introduction to PHP

HTTP Communication on Tizen

NETB 329 Lecture 13 Python CGI Programming

INTRODUCTION TO CGI PROGRAMMING By Jumail Bin Taliba, GMM, FSKSM, UTM INTRODUCTION

CGI Programming. What is "CGI"?

The World Wide Web. Internet

Apache FastCGI Tutorial

Form Processing in PHP

The Hypertext Markup Language (HTML) Part II. Hamid Zarrabi-Zadeh Web Programming Fall 2013

Web Engineering. Basic Technologies: Protocols and Web Servers. Husni

Server-Side Web Programming: Python (Part 1) Copyright 2017 by Robert M. Dondero, Ph.D. Princeton University

Common Gateway Interface CGI

CS4604 Prakash Spring 2016! Project 3, HTML and PHP. By Sorour Amiri and Shamimul Hasan April 20 th, 2016

UR what? ! URI: Uniform Resource Identifier. " Uniquely identifies a data entity " Obeys a specific syntax " schemename:specificstuff

ECE264 Fall 2013 Exam 1, September 24, 2013

C programming for beginners

Simple But Useful Tools for Interactive WWW Development

PYTHON CGI PROGRAMMING

Inf 202 Introduction to Data and Databases (Spring 2010)

Networking Basics. EC512 Spring /15/2015 EC512 - Prof. Thomas Skinner 1

Accessing CA-IDMS from Internet. VG-IDMS/Web Server Overview

HTML Forms. By Jaroslav Mohapl

3. WWW and HTTP. Fig.3.1 Architecture of WWW

Chapter 27 WWW and HTTP Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Web Programming. Based on Notes by D. Hollinger Also Java Network Programming and Distributed Computing, Chs.. 9,10 Also Online Java Tutorial, Sun.

Time: 3 hours. Full Marks: 70. The figures in the margin indicate full marks. Answer from all the Groups as directed. Group A.

HTML Tables and Forms. Outline. Review. Review. Example Demo/ Walkthrough. CS 418/518 Web Programming Spring Tables to Display Data"

Web History. Systemprogrammering 2006 Föreläsning 9 Web Services. Internet Hosts. Web History (cont) 1945: 1989: Topics 1990:

Outline of Lecture 5. Course Content. Objectives of Lecture 6 CGI and HTML Forms

Enterprise Java Unit 1- Chapter 3 Prof. Sujata Rizal Introduction to Servlets

Developing Online Databases and Serving Biological Research Data

Hands-On Perl Scripting and CGI Programming

CHAPTER 6: CREATING A WEB FORM CREATED BY L. ASMA RIKLI (ADAPTED FROM HTML, CSS, AND DYNAMIC HTML BY CAREY)

WWW Document Technologies

HTML. MPRI : Web Data Management. Antoine Amarilli Friday, December 7th 1/28

A programmer can create Internet application software without understanding the underlying network technology or communication protocols.

Common Gateway Interface

First Simple Interactive JSP example

Web Security, Part 1 (as usual, thanks to Dave Wagner and Vern Paxson)

LING 408/508: Computational Techniques for Linguists. Lecture 21

Outline. Lecture 8: CGI (Common Gateway Interface ) Common Gateway Interface (CGI) CGI Overview

Binghamton University. CS-211 Fall Variable Scope

Construction d Applications Réparties / Master MIAGE

Enterprise Knowledge Platform Adding the Login Form to Any Web Page

Denial-of-Service (DoS) & Web Attacks

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

Lecture (03) from static HTML to

Denial-of-Service, con t / Web Security

Web Services April 24, 2007

Lecture 5 Security and User Input. INLS 760 Web Databases Spring 2013 Rob Capra

Lesson 3. Form By Raymond Tsang. Certificate Programme in Cyber Security

Information Retrieval CS Lecture 13. Razvan C. Bunescu School of Electrical Engineering and Computer Science

Giving credit where credit is due

The New C Standard (Excerpted material)

ECE264 Summer 2013 Exam 1, June 20, 2013

Course Topics. IT360: Applied Database Systems. Introduction to PHP

Slybroadcast Global API Documentation Version 3.0 June 2018

Web technologies. Web. basic components. embellishments in browser. DOM (document object model)

COSC 3351 Software Design. Software Design Methodology. Edgar Gabriel. Spring Outline

CP215 Application Design

Secure Programming. Input Validation. Learning objectives Code Injection: Outline. 4 Code Injection

Javascript Lecture 23

Java Applets, etc. Instructor: Dmitri A. Gusev. Fall Lecture 25, December 5, CS 502: Computers and Communications Technology

CPET 581 E-Commerce & Business Technologies. Topics

Integrating legacy software with a Web front end

How the Web Works. Chapter 1. Modified by Marissa Schmidt Pearson

Crystal Enterprise. Overview. Contents. Web Server Overview - Internet Information System (IIS)

Jquery Ajax Json Php Mysql Data Entry Example

XML Services Troubleshooting

Overview of Forms. Forms are used all over the Web to: Types of forms: Accept information Provide interactivity

CS 3305 Intro to Threads. Lecture 6

CERTIFICATE IN WEB PROGRAMMING

Networking and Internet

Shankersinh Vaghela Bapu Institue of Technology

Bristol Institute of Technology

UFCEKG Lecture 4 Server Side Scripting & PHP

HTTP Communication on Tizen (Tizen Ver. 2.3)

LAB MANUAL SUBJECT: WEB TECHNOLOGY CLASS : T.E (COMPUTER) SEMESTER: VI

HTML forms and the dynamic web

Connecting with Computer Science Chapter 5 Review: Chapter Summary:

Handling multiple submit buttons in NET+OS development environment web-based applications

Transcription:

HTTP EC512 Spring 2015 2/15/2015 EC512 - Prof. Thomas Skinner 1

HTTP HTTP is the standard protocol used between a web browser and a web server. It is standardized by the World Wide Web Consortium, W3C www.w3c.org The latest standard documentation can be found at www.w3.org/protocols/http/1.1/rfc2616.pdf Assignment - read the HTTP standard document at least carefully enough to use it as a future reference. 2/15/2015 EC512 - Prof. Thomas Skinner 2

HTTP Operation The browser and web server communicate with a simple request/response mechanism. When you perform some action in your browser (open a URL, activate a link etc.) a request header is generated that is sent to the web server along with a possible body of information. The web server sends back a response header with the document you requested in the body of the response. Normally this is your HTML page. Images and other HTML elements are requested and responded to in a similar manner. A MIME type in the header specifies the type of the information in the body. 2/15/2015 EC512 - Prof. Thomas Skinner 3

Fiddler You can t look at requests and responses in your browser View source only shows the HTML A means to capture the raw data is needed Fiddler 2, the free tool from www.fiddlertool.com is a great utility You should install it on your system Demo in class 2/15/2015 EC512 - Prof. Thomas Skinner 4

Request Header 2/15/2015 EC512 - Prof. Thomas Skinner 5

Response Header MIME Type 2/15/2015 EC512 - Prof. Thomas Skinner 6

Response Data 2/15/2015 EC512 - Prof. Thomas Skinner 7

The Page 2/15/2015 EC512 - Prof. Thomas Skinner 8

The Common Gateway Interface CGI CGI is the fundamental way in which HTTP is used to communicate with server side applications, e.g., Perl scripts, ASP, ASP.NET etc. CGI is very simple. The HTML form is central to the operation of CGI. The data in a form is passed to the server using one of two methods: 1. GET Method 2. POST Method The following example shows the use of CGI without form arguments. It is written in C although other languages can be used. 2/15/2015 EC512 - Prof. Thomas Skinner 9

Simple CGI Program (prints environment variables) #include <stdio.h> int main(int argc, char* argv[], char* envp[]) { int i=0; printf("content-type: text/plain\n\n"); } while(envp[i]) { printf("%s\n", envp[i]); ++i; } return 0; 2/15/2015 EC512 - Prof. Thomas Skinner 10

Output 2/15/2015 EC512 - Prof. Thomas Skinner 11

A Simple Form <form method="get" action="cgi2.exe"> </form> <p>first name: <input type="text" name="first" size="20"></p> <p>last name: <input type="text" name="last" size="20"></p> <p><input type="submit" value="submit" name="b1"> <input type="reset" value="reset" name="b2"></p> 2/15/2015 EC512 - Prof. Thomas Skinner 12

Simple Form Display 2/15/2015 EC512 - Prof. Thomas Skinner 13

Print Query String #include <stdio.h> #include <stdlib.h> int main(int argc, char* argv[]) { char* s; s=getenv("query_string"); printf("content-type: text/plain\n\n"); printf("%s\n", s); return 0; } 2/15/2015 EC512 - Prof. Thomas Skinner 14

Query String Display 2/15/2015 EC512 - Prof. Thomas Skinner 15

A Look at the Headers 2/15/2015 EC512 - Prof. Thomas Skinner 16

2/15/2015 EC512 - Prof. Thomas Skinner 17

2/15/2015 EC512 - Prof. Thomas Skinner 18

Get and Post Methods With the GET method arguments are passed as an extended URL. Some characters need to be escaped. The POST method passes arguments in the body of the request. Both methods are commonly used and the particular method is specified in the <FORM> tag. POST method args are passed to the CGI program via standard input. 2/15/2015 EC512 - Prof. Thomas Skinner 19

A Simple Form <form method= POST" action="cgi3.exe"> </form> <p>first name: <input type="text" name="first" size="20"></p> <p>last name: <input type="text" name="last" size="20"></p> <p><input type="submit" value="submit" name="b1"> <input type="reset" value="reset" name="b2"></p> 2/15/2015 EC512 - Prof. Thomas Skinner 20

CGI program to echo POST method data (cgi3.exe) #include <stdio.h> #include <stdlib.h> int main(int argc, char* argv[]) { char s[1024]; char* ss; printf("content-type: text/plain\n\n"); ss=getenv("content_length"); if(ss) { int count=atoi(ss); for(int i=0; i<count; ++i) putchar(getchar()); } return 0; } 2/15/2015 EC512 - Prof. Thomas Skinner 21

Args in body 2/15/2015 EC512 - Prof. Thomas Skinner 22

Earlier form using POST method and cgi3.exe as the action 2/15/2015 EC512 - Prof. Thomas Skinner 23

New Uses of HTTP In recent years HTTP has been used as a transport protocol not exclusively for displaying web pages in web browsers. HTTP can be used to upload and download files. HTTP can be used to effectively provide network shares, WebDAV etc. See http://en.wikipedia.org/wiki/webdav Remote desktop type applications. HTTP provides transport for XML/SOAP web services. Central to all these uses is that a web server with extended capabilities is involved. 2/15/2015 EC512 - Prof. Thomas Skinner 24