applicationx www form urlencoded multipartform data textplain For examples

Applicationx www form urlencoded multipartform data

This preview shows page 40 - 51 out of 86 pages.

application/x-www-form-urlencoded multipart/form-data text/plain For examples (illustrated in following slides) 15/3/2020 COPYRIGHT © RICCI IEONG FOR UST TRAINING 2020 40
Image of page 40
HTML Forms (application/x- www-form-urlencoded) Default scheme Values are URL encoded 15/3/2020 COPYRIGHT © RICCI IEONG FOR UST TRAINING 2020 41
Image of page 41
HTML Forms (multipart/form- data) Value separated by separators (defined in request header) Allow each value to have different content type and other headers Commonly used with file upload or complex data 15/3/2020 COPYRIGHT © RICCI IEONG FOR UST TRAINING 2020 42
Image of page 42
HTML Forms (multipart/form- data) File upload example 15/3/2020 COPYRIGHT © RICCI IEONG FOR UST TRAINING 2020 43
Image of page 43
HTML Forms (text/plain) Replace space to ‘+’ only Rarely used 15/3/2020 COPYRIGHT © RICCI IEONG FOR UST TRAINING 2020 44
Image of page 44
HTTP Access Authentication (1) - Defined in RFC2617 - Specified by the Authorization request header: - If the client requests an entity requiring authorization, the server responds with a 401 message with WWW-Authenticate header, which is a challenge string. - If the client failed to authenticate, then the server responds with a 403 message. - Two type of common authentication methods - Basic - Digest 15/3/2020 COPYRIGHT © RICCI IEONG FOR UST TRAINING 2020 45
Image of page 45
HTTP Access Authentication (2) - Basic Authentication Example - Server request authentication in a 401 message: - WWW-Authenticate: Basic realm=“Restricted area” - Client send authentication information: - Authorization: Basic dXNlcjpwYXNzd29yZA== - The blue string is the Base 64 encoded version of the user id and password (user:password in the example) - Easy to decode 15/3/2020 COPYRIGHT © RICCI IEONG FOR UST TRAINING 2020 46
Image of page 46
HTTP Access Authentication (3) - Digest Authentication Example - Server request authentication in a 401 message: - WWW-Authenticate: Digest realm="realm", qop="auth,auth-int", algorithm="MD5", nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093", opaque="5ccc069c403ebaf9f0171e9517f40e41" - Client send authentication information: - Authorization: Digest username="user", realm="realm", nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093", uri="/dir/index.html", qop=auth, nc=00000001, nonce="0a4f113b", response="6629fae49393a05397450978507c4ef1", opaque="5ccc069c403ebaf9f0171e9517f40e41“ - Involves the use of hashing algorithm (by default MD5) and nonce to produce digest and checksum 15/3/2020 COPYRIGHT © RICCI IEONG FOR UST TRAINING 2020 47
Image of page 47
Web programming (Background Studies) 15/3/2020 COPYRIGHT © RICCI IEONG FOR UST TRAINING 2020 48
Image of page 48
HyperText Markup Languge (HTML) The most popular language for web pages Latest specifications is 4.01 by W3C (Dec. 1999) 5.0 is published by W3C A structure document with different elements, tags, attributes, etc. Difference browsers may generate page differently and may accept different elements 15/3/2020 COPYRIGHT © RICCI IEONG FOR UST TRAINING 2020 49
Image of page 49
HTML - Stands for “Hyper Text Markup Language” - Defines how a webpage looks like - Most commonly used version: HTML4 - Latest version: HTML5 (candidate recommendation), introduces many new features - <video>, <audio>, <canvas> tag - A large set of new API: - Web storage - Drag-and-drop - Cross-document messaging - etc - Also some related specification published (not exactly in HTML5): - Geolocation API - File API - Indexed Database API - XHTML is a XML serialization of HTML 15/3/2020 COPYRIGHT © RICCI IEONG FOR UST TRAINING 2020 50
Image of page 50
Image of page 51

You've reached the end of your free preview.

Want to read all 86 pages?

  • Spring '18
  • Ricci
  • World Wide Web, Web server, Web browser

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture