O'Reilly logo

Mastering Internet of Things by Peter Waher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Applying headers

Both requests and responses contain HTTP headers. These consist of sets of key-value pairs. Normally, clients do not need to set these headers explicitly. It is typically done by the HTTP clients being used. But sometimes, you need to set some of these headers manually, to customize a request according to your needs. Following is a shot list of useful headers:

Header

Description

Accept

If the resource supports multiple content type encodings, you can specify your preference using the Accept header.

Cache-Control

Controls how the response may be cached.

Content-Type

The media type of the content payload.

ETag

An entity tag is a string identifying the content. It can be a hash value of the content, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required