Understanding HTTP in E-commerce: POST Requests, Response Codes, and Header Fields, Slides of Fundamentals of E-Commerce

An in-depth look into the role of http in electronic commerce, focusing on post requests, response status codes, and useful header fields. Learn about the structure of a post request, the meaning of various header fields, and the importance of mime and content negotiation in this context.

Typology: Slides

2012/2013

Uploaded on 07/29/2013

alok-sarath
alok-sarath 🇮🇳

4.3

(35)

143 documents

1 / 10

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
3-11
Electronic Commerce (WS-02/03)
POST Request: Application View
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Understanding HTTP in E-commerce: POST Requests, Response Codes, and Header Fields and more Slides Fundamentals of E-Commerce in PDF only on Docsity!

Electronic Commerce (WS-02/03) 3-

POST Request: Application View

Electronic Commerce (WS-02/03) 3-

POST Request: Protocol View: Header

POST / HTTP/1.

Referer: http://www.sts.tu-harburg.de/ teaching/ws-02.03/ECommerce/ registerGET.html#danke Connection: Keep-Alive User-Agent: Mozilla/4.7 [de] (WinNT; I) Host: localhost: Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, / Accept-Encoding: gzip Accept-Language: de Accept-Charset: iso-8859-1,*,utf- Content-type: text/plain Content-Disposition: inline; form-data Request Line Headers (see slide 3.50) empty line here (CR/LF)

Electronic Commerce (WS-02/03) 3-

HTTP Response

response ::= status-line ( general-header | entity-header | response-header )* <CR/LF> ( message-body )? status-line ::= http-version status-code reason-phrase <CR/LF> Purpose: Status report on protocol execution The status-code is a three-digit number giving information about the operation (success, failure and reason). The reason-phrase is a short phrase describing the status-code (typically in English). Status-codes classes: o 1xx Informational o 2xx Successful o 3xx Redirection o 4xx Client Error o 5xx Server Error

Electronic Commerce (WS-02/03) 3-

HTTP Useful Header Fields

Header fields useful in EC applications: General header fields: o Via : Helps trace-route messages through the internet. o Transfer-Encoding : Used for compressing large message contents (gzip). Entity header fields: o Content-Encoding : See Transfer-Encoding. Defines that content is stored encoded at the server. o Content-Type : Defines the content type (see MIME). o Expires : Tells proxies and gateways when to clear cached copies. Request header field: o Referer : Tells the server the URL of the page that contained a link the client followed. Used for profiling users and accounting revenues in the Affiliate Business Model. Response header field: o WWW-Authenticate : Requests authentication from the client for a given realm. header field definition: see slide 3.

Electronic Commerce (WS-02/03) 3-

HTTP Content Negotiation (1)

Purpose: A resource can be available at a server in several different variants. Client and server should negotiate on which variant to retrieve. Variants follow three categories: o Language (German, English, Korean, Bantu, ...) o Quality (lo-res vs. hi-res, b/w vs. color images, abstract text vs. full paper) o Encoding (character-set: US-ASCII, Unicode, ...) Clients and servers can negotiate these parameters following three strategies: o Server-driven negotiation (The server „knows“ what is good for the client) o Agent-driven negotiation (Client choice) o Transparent negotiation (A proxy negotiates what is best for the client)

Electronic Commerce (WS-02/03) 3-

HTTP Content Negotiation (2)

de uk fr Client Server req rsp chce de uk fr Proxy Server req rsp req rsp chce req rsp Client de uk fr Client Server req rsp req rsp chce a) server-driven negotiation b) agent-driven negotiation c) transparent negotiation

Electronic Commerce (WS-02/03) 3-

HTTP/1.1 (1)

Main design goal: Gaining performance with a better request/response-Interaction Model. Problem: The TCP connection is closed after the server‘s response. Performance gains possible from TCP connections that remain open for several request/response cycles. Choices: o Persistent HTTP (P-HTTP): TCP connections are kept over (alive) between client and server. Connection: Keep-Alive o HTTP over Transaction TCP (T/TCP): TCP connections are closed after each cycle, but overhead for reopening is reduced significantly. Chosen Solution:

  • P-HTTP integrated into HTTP/1.1. Request header field