Developing RESTful web APIs in Java Jérôme Louvel Thierry Templier Thierry Boileau FOREWORD BY Brian Sletten M A N N I N G Restlet in Action Download from Wow! eBook <www.wowebook.com> Download from Wow! eBook <www.wowebook.com> Restlet in Action DEVELOPING RESTFUL WEB APIS IN JAVA JÉRÔME LOUVEL THIERRY TEMPLIER THIERRY BOILEAU MANNING SHELTER ISLAND Download from Wow! eBook <www.wowebook.com> For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact Special Sales Department Manning Publications Co. 20 Baldwin Road PO Box 261 Shelter Island, NY 11964 Email: [email protected] ©2013 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15 percent recycled and processed without the use of elemental chlorine. Manning Publications Co. Development editor: Jeff Bleiel 20 Baldwin Road Copyeditor: Corbin Collins PO Box 261 Proofreaders: Elizabeth Martin, Melody Dolab Shelter Island, NY 11964 Typesetter: Dennis Dalinnik Cover designer: Marija Tudor ISBN: 9781935182344 Printed in the United States of America 1 2 3 4 5 6 7 8 9 10 – MAL – 18 17 16 15 14 13 12 Download from Wow! eBook <www.wowebook.com> To my father, Guy Louvel, for his love of life and people and for inspiring my passion for computers —J.L. Download from Wow! eBook <www.wowebook.com> Download from Wow! eBook <www.wowebook.com> brief contents PART 1 GETTING STARTED. ......................................................1 1 ■ Introducing the Restlet Framework 3 2 ■ Beginning a Restlet application 13 3 ■ Deploying a Restlet application 46 PART 2 GETTING READY TO ROLL OUT....................................79 4 ■ Producing and consuming Restlet representations 81 5 ■ Securing a Restlet application 121 6 ■ Documenting and versioning a Restlet application 151 7 ■ Enhancing a Restlet application with recipes and best practices 165 PART 3 FURTHER USE POSSIBILITIES......................................201 8 ■ Using Restlet with cloud platforms 203 9 ■ Using Restlet in browsers and mobile devices 242 10 ■ Embracing hypermedia and the Semantic Web 274 11 ■ The future of Restlet 294 vii Download from Wow! eBook <www.wowebook.com> Download from Wow! eBook <www.wowebook.com> contents foreword xvii preface xix acknowledgments xxi about this book xxiii about the cover illustration xxvii PART 1 GETTING STARTED. ...........................................1 1 Introducing the Restlet Framework 3 1.1 “Hello World” with Restlet 5 Coding a ServerResource subclass 5 ■ Running the server 6 Using the ClientResource class 7 1.2 Overview of the Restlet Framework 8 Main benefits of the Restlet API 9 ■ Overall design of the Restlet Framework 10 ■ Available editions and deployment targets 11 1.3 Summary 12 2 Beginning a Restlet application 13 2.1 The purpose of Restlet applications 14 2.2 The structure of Restlet applications 15 ix Download from Wow! eBook <www.wowebook.com>
Description: