Chapter 6. Advanced HTTP Techniques
CHAPTER OVERVIEW The Decorator Approach The Process-Chain Approach Session Tracking via HTTP Cookies HTTP Basic Authentication HTTP Digest Authentication Secure HTTP
In the previous three chapters, we used HTTP to transport text and binary data back and forth between mobile devices and backend servers. HTTP is crucial in end-to-end mobile commerce solutions, since it is ubiquitously supported by today's application servers, gateway servers, and mobile devices. Emerging integration standards such as XML Web Services are all based on HTTP. However, HTTP was originally designed to carry stateless and unencrypted HTML content to anonymous Internet surfers. J2ME, especially the MIDP, supports only the most basic HTTP features. MIDP's HTTP support is not sufficient for enterprise applications. Fortunately, HTTP is a flexible protocol. We can use HTTP headers to pass additional information. HTTP headers are just HeaderName: Header-Value pairs that are attached to HTTP requests and responses. The use of many HTTP header fields has already been standardized. This chapter first presents two generic ways to handle HTTP headers. Code examples are then used to illustrate how to support HTTP cookies and authentication headers (both basic and digest authentication) under our framework. Finally, we discuss secure HTTP. |