Table of Contents

 

Copyright

Brief Table of Contents

Table of Contents

Foreword

Preface

Acknowledgments

About this Book

Author Online

About the Author

About the Cover Illustration

1. Introducing CORS

Chapter 1. The Core of CORS

1.1. What is CORS?

1.2. CORS by example

1.2.1. Setting up the request

1.2.2. Sending the request

1.2.3. Processing the response

1.3. Benefits of CORS

1.3.1. Wider audience

1.3.2. Servers stay in charge

1.3.3. Flexibility

1.3.4. Easy for developers

1.3.5. Reduced maintenance overhead

1.4. Summary

Chapter 2. Making CORS requests

2.1. What is a cross-origin request?

2.2. Browser support for CORS

2.3. Using the XMLHttpRequest object

2.3.1. Sending an HTTP request

2.3.2. Handling the HTTP response

2.3.3. Including cookies on cross-origin requests

2.4. XDomainRequest object in Internet Explorer 8 and 9

2.4.1. Differences between XDomainRequest and XMLHttpRequest

2.5. Canvas and cross-origin images

2.6. CORS requests from jQuery

2.7. Summary

2. CORS on the server

Chapter 3. Handling CORS requests

3.1. Setting up the sample code

3.1.1. Setting up the sample API

3.1.2. Setting up the sample client

3.1.3. Running the sample app

3.2. Making a CORS request

3.3. Anatomy of a CORS request

3.3.1. The players in a CORS request

3.3.2. Lifecycle of a CORS request

3.4. Making a request with the Origin header

3.4.1. Viewing the Origin header