357 building hypermedia APIs with HTML5 and node

242 171 0
357 building hypermedia APIs with HTML5 and node

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

... www.it-ebooks.info Building Hypermedia APIs with HTML5 and Node Mike Amundsen Beijing • Cambridge • Farnham • Kưln • Sebastopol • Tokyo www.it-ebooks.info Building Hypermedia APIs with HTML5 and Node by... release details Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc Building Hypermedia APIs with HTML5 and Node, the image of a rough-legged... attribution An attribution usually includes the title, author, publisher, and ISBN For example: Building Hypermedia APIs with HTML5 and Node by Mike Amundsen (O’Reilly) Copyright 2012 O’Reilly Media,

Ngày đăng: 11/07/2018, 09:47

Mục lục

  • Table of Contents

  • Foreword

  • Preface

    • Hypermedia API Design

    • Intended Audience

    • What Is Not Covered

    • Contents of This Book

    • Coding Style for This Book

    • Conventions Used in This Book

    • Using Code Examples

    • Safari® Books Online

    • How to Contact Us

    • Acknowledgements

  • Chapter 1. Understanding Hypermedia

    • HTTP, MIME, and Hypermedia

      • HTTP Is the Transfer Protocol

      • MIME Is the Media Type Standard

      • Hypermedia Is the Engine

        • From links to controls

        • Hypermedia types

    • Programming the Web with Hypermedia APIs

      • The Type-Marshaling Dilemma

        • Shared schema

        • URI construction

        • Payload decoration

        • Narrow media types

      • The Hypermedia Solution

        • Metadata about the data

        • Metadata about the application

        • Summary

    • Identifying Hypermedia : H-Factors

      • Link Factors

        • Embedding Links (LE)

        • Outbound Links (LO)

        • Templated Links (LT)

        • Idempotent Links (LI)

        • Non-Idempotent Links (LN)

      • Control Factors

        • Read Controls (CR)

        • Update Controls (CU)

        • Method Controls (CM)

        • Link Annotation Controls (CL)

        • Summary

    • Hypermedia Design Elements

      • Base Format

        • XML

        • JSON

        • HTML

        • Others

      • State Transfer

        • Read-only

        • Predefined

        • Ad-Hoc

      • Domain Style

        • Specific

        • General

        • Agnostic

      • Application Flow

        • None

        • Intrinsic

        • Applied

    • Summary

    • What’s Next?

  • Chapter 2. XML Hypermedia

    • Scenario

    • Designing the Maze XML Media Type

      • Identifying the State Transitions

      • Selecting the Basic Design Elements

      • The Maze+XML Document

        • The collection element

        • The item element

        • The cell element

        • The error element

    • Sample Data

    • The Server Code

      • The Collection State Response

      • The Item State Response

      • The Cell State Response

      • The Exit State Response

    • The Client Code

      • Maze Game Example

        • HTML5 Markup

        • JavaScript

      • Maze Bot Example

        • HTML5 Markup

        • JavaScript

    • Summary

  • Chapter 3. JSON Hypermedia

    • Scenario

    • Designing the Collection+JSON Media-Type

      • Identifying the State Transitions

      • Selecting the Basic Design Elements

      • The Collection+JSON Document

        • Objects

          • The collection object

          • The error object

        • Arrays

          • The template object

          • The data array

          • The items array

          • The links array

    • The Tasks Application Semantics

      • The Data Model

      • The Write Template

      • Predefined Queries

    • Sample Data

      • Task Documents

      • Design Document

    • The Server Code

      • The Collection Response

      • The Item Response

      • The Query Representations

      • Handling Template Writes

    • The Client Code

      • The Tasks SPI Example

        • HTML5 markup

        • JavaScript

      • The Tasks Command Line Example

        • The general approach

        • The add-task.js application

    • Summary

  • Chapter 4. HTML5 Hypermedia

    • Scenario

    • Designing the Microblog Media Type

      • Expressing Application Domain Semantics in HTML5

      • Identifying the State Transitions

        • State blocks

          • Users

          • Messages

        • Transfer blocks

          • Queries

          • Create new user

          • Update existing user

          • Follow a user

          • Search for users

          • Add a new message

      • Selecting the Basic Design Elements

      • The Microblog Application Profile

        • Current user and state data

        • ID attribute values

        • Class attribute values

        • Name attributes values

        • Rel attribute values

    • Sample Data

      • User Documents

      • Message Documents

      • Follow Documents

      • Design Document

    • The Server Code

      • Authenticating Users

      • Registering a New User

      • Message Responses

      • User Responses

    • The Client Code

      • The POSH Example

      • The Ajax QuoteBot Example

        • The QuoteBot scenario

        • QuoteBot HTML5

        • QuoteBot JavaScript

          • Setup code

          • Making requests

          • Processing responses

          • Support routines

    • Summary

  • Chapter 5. Documenting Hypermedia

    • Requirements, Compliance, and RFC 2119

      • The RFC 2119 Keywords

      • Sample Documentation Using RFC 2119 Keywords

      • Defining Compliance

    • Documenting Media Type Designs

      • General Layout

        • Front matter

        • Format

        • Examples

        • Tutorials

      • Documenting XML Designs

      • Documenting JSON Designs

      • Documenting HTML Designs

      • Documenting Application Domain Specifics

        • Data elements

          • Domain-specific data elements

          • Domain-generic data elements

        • Hypermedia affordances

          • Domain-specific hypermedia controls

          • Domain-generic hypermedia controls

      • Publishing Media Type Designs

    • Extending and Versioning Media Types

      • Extending

        • Forward compatibility

        • Backward compatibility

        • Rules for extending media types

      • Versioning

        • Deciding when to version a media type

        • Rules for versioning a media type

          • It should be easy to identify new versions of a media type

          • Implementations should reject unsupported versions

    • Registering Media Types and Link Relations

      • Media Types

        • Vendor/Personal tree media type registrations

        • Standard tree media type registrations

      • Link Relation Types

        • Registering link relations with the Microformats community

        • Registering link relations with the IANA

    • Design and Implementation Tips

      • Joshua Bloch’s Characteristics of a Good API

      • Roy Fielding’s Hypertext API Guidelines

      • Jon Postel’s Robustness Principle

      • Other Considerations

        • Getting it right but not complete

        • Maintain media type design and schema separately

        • Authentication is not part of the hypermedia design

        • Testing media type designs

  • Afterword

  • Appendix A. References

    • Chapter 1

    • Chapter 2

    • Chapter 3

    • Chapter 4

    • Chapter 5

  • Appendix B. Additional Reading

    • Books

    • Other

  • Appendix C. Maze+XML Media Type

    • Elements

      • cell

      • code

      • collection

      • debug

      • error

      • item

      • link

      • maze

      • message

      • title

    • Attributes

      • debug

      • href

      • rel

      • side

      • total

      • version

    • Link Relations

      • collection

      • current

      • east

      • exit

      • maze

      • north

      • south

      • start

      • west

    • Data Types

      • CDATA

      • NUMBER

      • TEXT

      • URI

    • Extensibility

  • Appendix D. Collection+JSON Media Type

    • General Concepts

      • Reading and Writing Data

        • Reading collections

        • Adding an item

        • Reading an item

        • Updating an item

        • Deleting an item

      • Query Templates

    • Objects

      • collection

      • error

      • template

    • Arrays

      • data

      • items

      • links

      • queries

    • Properties

      • code

      • href

      • message

      • name

      • prompt

      • rel

      • render

      • title

      • value

      • version

    • Link Relations

      • collection

      • items

      • template

      • queries

      • Other Link Relation Values

    • Data Types

      • ARRAY

      • NUMBER

      • OBJECT

      • STRING

      • URI

      • VALUE

    • Extensibility

  • Appendix E. Microblogging HTML Semantic Profile

    • General Concepts

      • Compliance

      • Design Characteristics

      • Additional Constraints

    • Semantic Profile

      • Class Attribute Values

      • ID Attribute Values

      • Name Attribute Values

      • Rel Attribute Values

  • Appendix F. IANA Media Type Registration Document

  • Appendix G. IETF Link Relations Internet Draft

  • Appendix H. Source Code, Software, and Installation Notes

    • Source Code

    • Prerequisites

    • CouchDB

    • Node.js

    • Cloud Services

    • Authoring

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan