September 2016
Intermediate to advanced
247 pages
5h 51m
English
© Paul Redmond 2016
Paul Redmond, Lumen Programming Guide, 10.1007/978-1-4842-2187-7_6
Paul Redmond1
(1)Phoenix, Arizona, USA
During your work on the Book API in Chapter 5 it became evident that you need to start using a separate test database. You also don’t have very good error responses for API consumers yet. Responding to a client with an HTML error that expects JSON is not going to cut it anymore. When an API consumer interacts with your API, you want to respond with the correct Content-Type header. For now, you will assume all of your consumers want JSON, and in my experience, JSON is typically what consumers want.
The main focus of this chapter will be error responses, but before you work on error responses ...
Read now
Unlock full access