Before we start using Chef API, we need to follow a few rules:
Use a Chef server running the version 11.X.
The Accept header must be set to
application/JSON
.For the
PUT
andPOST
requests, the Content-Type header must be an application/JSON.The X-Chef-Version header should be set to the version of Chef that we are using.
The request must be signed using
Mixlib::Authentication
. We'll see more about this later in this chapter.The request must be well formatted. You can use the
Chef::REST
library to ensure this or use ridley.