Book Image

Heroku Cookbook

By : Mike Coutermarsh
Book Image

Heroku Cookbook

By: Mike Coutermarsh

Overview of this book

Heroku is a Platform as a Service that enables developers to rapidly deploy and scale their web applications. Heroku is designed for developer happiness, freeing developers from doing system administrative tasks such as configuring servers and setting up load balancers. Developers are able to focus on what they do best, building web applications, while leaving the details of deployment and scaling to the experts at Heroku. This practical guide is packed with step-by-step solutions to problems faced by every production-level web application hosted on Heroku. You'll quickly get comfortable with managing your Heroku applications from the command line and then learn everything you need to know to deploy and administer production-level web applications.
Table of Contents (17 chapters)
Heroku Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Making our first API request with HTTPie


The Heroku Platform API is a set of HTTP endpoints that enables us to fully manage our applications. Each endpoint has a set of available actions. They are RESTful; this means that they use HTTP request types (GET, PATCH, POST, and DELETE) to determine what action we want from the API. GET is used to retrieve data such as a list of our applications. PATCH is used to make updates to the existing data, such as making a change to a configuration variable. POST is used to create something new, such as a new application. Finally, DELETE is used for exactly what it sounds like, deleting data.

In this recipe, we will learn about the conventions to make requests to the Heroku API. We will also be introduced to HTTPie, which is a command-line tool to send HTTP requests. It's similar to cURL, but easier to use.

Getting ready

To begin, we'll need to install HTTPie on our machine.

OS X

On OS X, we can install HTTPie via Homebrew:

$ brew install httpie

Linux

Depending...