You are previewing Introduction to JavaScript Object Notation.
O'Reilly logo
Introduction to JavaScript Object Notation

Book Description

What is JavaScript Object Notation (JSON) and how can you put it to work? This concise guide helps busy IT professionals get up and running quickly with this popular data interchange format, and provides a deep understanding of how JSON works. Author Lindsay Bassett begins with an overview of JSON syntax, data types, formatting, and security concerns before exploring the many ways you can apply JSON today.

From Web APIs and server-side language libraries to NoSQL databases and client-side frameworks, JSON has emerged as a viable alternative to XML for exchanging data between different platforms. If you have some programming experience and understand HTML and JavaScript, this is your book.

Table of Contents

  1. Preface
    1. Audience
    2. Approach to JSON
    3. Conventions Used in This Book
    4. Using Code Examples
    5. SafariĀ® Books Online
    6. How to Contact Us
    7. Acknowledgments
  2. 1. What Is JSON?
    1. JSON Is a Data Interchange Format
    2. JSON Is Programming Language Independent
    3. Key Terms and Concepts
  3. 2. JSON Syntax
    1. JSON Is Based on JavaScript Object Literals
    2. Name-Value Pairs
    3. Proper JSON Syntax
    4. Syntax Validation
    5. JSON as a Document
    6. The JSON MediaType
    7. Key Terms and Concepts
  4. 3. JSON Data Types
    1. Quick Look at Data Types
    2. The JSON Data Types
    3. The JSON Object Data Type
    4. The JSON String Data Type
    5. The JSON Number Data Type
    6. The JSON Boolean Data Type
    7. The JSON null Data Type
    8. The JSON Array Data Type
    9. Key Terms and Concepts
  5. 4. JSON Schema
    1. Contracts with Validation Magic
    2. Introduction to JSON Schema
    3. Key Terms and Concepts
  6. 5. JSON Security Concerns
    1. A Quick Look at Client- and Server-Side Relationships
    2. Cross-Site Request Forgery (CSRF)
    3. Injection Attacks
      1. Cross-Site Scripting (XSS)
      2. Holes in Security: Architectural Decisions
    4. Key Terms and Concepts
  7. 6. The JavaScript XMLHttpRequest and Web APIs
    1. Web APIs
    2. The JavaScript XMLHttpRequest
    3. Relationship Woes and Rules About Sharing
      1. Cross-Origin Resource Sharing (CORS)
      2. JSON-P
    4. Key Terms and Concepts
  8. 7. JSON and Client-Side Frameworks
    1. jQuery and JSON
    2. AngularJS
    3. Key Terms and Concepts
  9. 8. JSON and NoSQL
    1. The CouchDB Database
    2. The CouchDB API
    3. Key Terms and Concepts
  10. 9. JSON on the Server Side
    1. Serializing, Deserializing, and Requesting JSON
      1. ASP.NET
      2. PHP
      3. A Smorgasbord of JSON HTTP Requests
      4. Ruby on Rails
      5. Node.js
      6. Java
    2. Key Terms and Concepts
  11. 10. Conclusion
    1. JSON as a Configuration File
    2. The Big Picture
  12. Index