Book Image

Building Web Services with Windows Azure (new)

Book Image

Building Web Services with Windows Azure (new)

Overview of this book

Table of Contents (17 chapters)
Building Web Services with Microsoft Azure
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Introduction
5
Connecting Applications with Microsoft Azure Service Bus
Index

Content negotiation


Content negotiation is an HTTP technique to identify the "best available" response for a client request when multiple responses may be available on the server.

Note

The RFC 2616 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec12.html) specification for HTTP allows server-driven, agent-driven, and transparent negotiations. For the scope of this chapter, we focus on server-driven negotiations.

The negotiation between the client and the server is accomplished through a set of HTTP headers. These header fields are used by the client to express the desired content type or media type, this information is then used by the server to format the response in a way the client can understand:

Field

Description

Accept headers

These specify certain attributes that are acceptable for a response. These headers specify to the server the type of response expected. For example, Accept: application/json will expect a JSON response. Other Accept headers include Accept-Charset, Accept-Encoding...