Section 7.1. A review of request and response formats


7.1. A review of request and response formats

Before we dive into the JSON versus XML debate, let's review the data formats we've already used in the first six chapters.

 Everything in the first part of the book sent text to the server using name/value pairs. Plain Text Requests Plain Text Responses    PHP script All these earlier apps got text back from the server, too. Remember, even with POST requests in Chapter 5, we were sending plain text. Chapter 4 was all about the DOM... no requests or responses here. In Chapter 6, we were still sending text in our requests. XML makes it easy for the server to send more complex responses to your requests... but your requests are still usually better off as plain text. Plain Text Request XML Response             PHP script The server finally got to say more, though, and sent XML back in its responses. 




Head Rush Ajax
Head Rush Ajax (Head First)
ISBN: 0596102259
EAN: 2147483647
Year: 2004
Pages: 241

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net