100% found this document useful (1 vote)
471 views

Coding Clean, Reliable, and Safe REST APIs with ASP.NET Core 8 1st Edition Anthony Giretti - Download the ebook in PDF with all chapters to read anytime

The document provides information about the book 'Coding Clean, Reliable, and Safe REST APIs with ASP.NET Core 8' by Anthony Giretti, including details on how to download it and explore additional resources at ebookmass.com. It outlines the book's content, which covers various aspects of developing REST APIs using ASP.NET Core 8, including best practices, clean architecture, and security measures. The document also lists other recommended books related to RESTful APIs and ASP.NET development.

Uploaded by

mansiajuste
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
471 views

Coding Clean, Reliable, and Safe REST APIs with ASP.NET Core 8 1st Edition Anthony Giretti - Download the ebook in PDF with all chapters to read anytime

The document provides information about the book 'Coding Clean, Reliable, and Safe REST APIs with ASP.NET Core 8' by Anthony Giretti, including details on how to download it and explore additional resources at ebookmass.com. It outlines the book's content, which covers various aspects of developing REST APIs using ASP.NET Core 8, including best practices, clean architecture, and security measures. The document also lists other recommended books related to RESTful APIs and ASP.NET development.

Uploaded by

mansiajuste
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

Visit ebookmass.

com to download the full version and


explore more ebook or textbook

Coding Clean, Reliable, and Safe REST APIs with


ASP.NET Core 8 1st Edition Anthony Giretti

_____ Click the link below to download _____


https://ebookmass.com/product/coding-clean-reliable-and-
safe-rest-apis-with-asp-net-core-8-1st-edition-anthony-
giretti/

Explore and download more ebook or textbook at ebookmass.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Coding Clean, Reliable, and Safe REST APIs with ASP.NET


Core 8: Develop Robust Minimal APIs with .NET 8 Anthony
Giretti
https://ebookmass.com/product/coding-clean-reliable-and-safe-rest-
apis-with-asp-net-core-8-develop-robust-minimal-apis-with-
net-8-anthony-giretti/

Pro RESTful APIs with Micronaut: Build Java-Based


Microservices with REST, JSON, and XML, 2nd Edition Sanjay
Patni
https://ebookmass.com/product/pro-restful-apis-with-micronaut-build-
java-based-microservices-with-rest-json-and-xml-2nd-edition-sanjay-
patni/

Pro RESTful APIs with Micronaut: Build Java-Based


Microservices with REST, JSON, and XML 2 / converted
Edition Sanjay Patni
https://ebookmass.com/product/pro-restful-apis-with-micronaut-build-
java-based-microservices-with-rest-json-and-xml-2-converted-edition-
sanjay-patni/

Architecting ASP.NET Core Applications Carl-Hugo Marcotte

https://ebookmass.com/product/architecting-asp-net-core-applications-
carl-hugo-marcotte/
ASP.NET 8 Best Practices 1 / converted Edition Jonathan R.
Danylko

https://ebookmass.com/product/asp-net-8-best-practices-1-converted-
edition-jonathan-r-danylko/

Geometric Patterns with Creative Coding: Coding for the


Arts 1st Edition Selçuk Artut

https://ebookmass.com/product/geometric-patterns-with-creative-coding-
coding-for-the-arts-1st-edition-selcuk-artut/

Geometric Patterns with Creative Coding 1st Edition Selcuk


Artut

https://ebookmass.com/product/geometric-patterns-with-creative-
coding-1st-edition-selcuk-artut/

Pro ASP.NET Core 3: Develop Cloud-Ready Web Applications


Using MVC, Blazor, and Razor Pages

https://ebookmass.com/product/pro-asp-net-core-3-develop-cloud-ready-
web-applications-using-mvc-blazor-and-razor-pages/

Saving Finley: Military Hero, Heroine Romance (Safe and


Secure Book 8) Alyssa Bailey

https://ebookmass.com/product/saving-finley-military-hero-heroine-
romance-safe-and-secure-book-8-alyssa-bailey/
Coding Clean,
Reliable, and Safe
REST APIs with
ASP.NET Core 8
Develop Robust Minimal
APIs with .NET 8

Anthony Giretti
Coding Clean, Reliable, and Safe REST APIs with ASP.NET Core 8:
Develop Robust Minimal APIs with .NET 8
Anthony Giretti
La Salle, QC, Canada

ISBN-13 (pbk): 978-1-4842-9978-4 ISBN-13 (electronic): 978-1-4842-9979-1


https://doi.org/10.1007/978-1-4842-9979-1
Copyright © 2023 by Anthony Giretti
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or
part of the material is concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way,
and transmission or information storage and retrieval, electronic adaptation, computer software,
or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark
symbol with every occurrence of a trademarked name, logo, or image we use the names, logos,
and images only in an editorial fashion and to the benefit of the trademark owner, with no
intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if
they are not identified as such, is not to be taken as an expression of opinion as to whether or not
they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of
publication, neither the authors nor the editors nor the publisher can accept any legal
responsibility for any errors or omissions that may be made. The publisher makes no warranty,
express or implied, with respect to the material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Smriti Srivastava
Development Editor: Laura Berendson
Editorial Assistant: Gryffin Winkler
Cover image designed by Freepik (www.freepik.com)
Distributed to the book trade worldwide by Springer Science+Business Media New York, 1
New York Plaza, 1 FDR Dr, New York, NY 10004. Phone 1-800-SPRINGER, fax (201) 348-4505,
e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a
California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc
(SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail booktranslations@springernature.com; for
reprint, paperback, or audio rights, please e-mail bookpermissions@springernature.com.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook
versions and licenses are also available for most titles. For more information, reference our Print
and eBook Bulk Sales web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is
available to readers on the Github repository. For more detailed information, please visit
https://www.apress.com/gp/services/source-code.
Paper in this product is recyclable
Table of Contents
About the Author���������������������������������������������������������������������������������ix

About the Technical Reviewer�������������������������������������������������������������xi

Acknowledgments�����������������������������������������������������������������������������xiii

Prerequisites��������������������������������������������������������������������������������������xv

Introduction��������������������������������������������������������������������������������������xvii

Chapter 1: Introducing HTTP and REST�������������������������������������������������1


Unveiling HTTP Behind the Web����������������������������������������������������������������������������1
The Characteristics of HTTP����������������������������������������������������������������������������3
HTTP Requests and Responses�����������������������������������������������������������������������4
HTTP Implementation��������������������������������������������������������������������������������������5
Extend Your Talent on the Web with REST Architecture Style�����������������������������32
REST Constraints�������������������������������������������������������������������������������������������33
REST Good Practices�������������������������������������������������������������������������������������34
Summary������������������������������������������������������������������������������������������������������������41

Chapter 2: Introducing ASP.NET Core 8�����������������������������������������������43


ASP.NET Core Fundamentals�������������������������������������������������������������������������������44
ASP.NET Core Web API�����������������������������������������������������������������������������������������53
ASP.NET Core Minimal APIs���������������������������������������������������������������������������������65
Summary������������������������������������������������������������������������������������������������������������69

iii
Table of Contents

Chapter 3: Introduction to Application Development


Best Practices������������������������������������������������������������������������������������71
Getting the Right Frame of Mind�������������������������������������������������������������������������72
A Basic Understanding of the Business���������������������������������������������������������72
Problem-Solving Skills����������������������������������������������������������������������������������72
Understanding Programming Paradigms������������������������������������������������������73
Logical and Structured Thinking��������������������������������������������������������������������73
Clean Architecture Fundamentals�����������������������������������������������������������������������74
Clean Code Fundamentals����������������������������������������������������������������������������������79
General Coding Fundamentals����������������������������������������������������������������������79
Coding Style Fundamentals���������������������������������������������������������������������������83
OWASP Principles�����������������������������������������������������������������������������������������������86
Summary������������������������������������������������������������������������������������������������������������90

Chapter 4: Basics of Clean REST APIs������������������������������������������������91


Routing with ASP.NET Core 8������������������������������������������������������������������������������92
ASP.NET Core Routing������������������������������������������������������������������������������������92
RouteGroups������������������������������������������������������������������������������������������������103
Parameter Binding��������������������������������������������������������������������������������������������107
What’s Precisely Parameter Binding?���������������������������������������������������������108
Parameter Binding by Example�������������������������������������������������������������������109
Validating Inputs�����������������������������������������������������������������������������������������������119
Object Mapping�������������������������������������������������������������������������������������������������129
Managing CRUD Operations and HTTP Statuses�����������������������������������������������135
Handling HTTP Statuses������������������������������������������������������������������������������136
Creating the Services to Handle CRUD Operations��������������������������������������138
Creating the Endpoints to Handle CRUD Operations������������������������������������141
Downloading and Uploading Files���������������������������������������������������������������������151
Downloading Files���������������������������������������������������������������������������������������151

iv
Table of Contents

Uploading Files��������������������������������������������������������������������������������������������155
Streaming Content��������������������������������������������������������������������������������������������169
Handling CORS��������������������������������������������������������������������������������������������������171
API Versioning���������������������������������������������������������������������������������������������������177
Versioning by Headers���������������������������������������������������������������������������������178
Versioning by Route�������������������������������������������������������������������������������������187
Documenting APIs���������������������������������������������������������������������������������������������190
Managing API Versions in Swagger�������������������������������������������������������������192
Adding Comments on Endpoints�����������������������������������������������������������������199
Grouping Endpoints by Tag��������������������������������������������������������������������������206
Other Customizations����������������������������������������������������������������������������������207
Summary����������������������������������������������������������������������������������������������������������212

Chapter 5: Going Further with Clean REST APIs�������������������������������213


Encapsulating Minimal Endpoint Implementation���������������������������������������������214
Implementing Custom Parameter Binding��������������������������������������������������������219
Example of Custom Parameter Binding from Headers��������������������������������220
Example of Custom Parameter Binding from the From Data�����������������������222
Using Middlewares�������������������������������������������������������������������������������������������225
Using Action Filters�������������������������������������������������������������������������������������������238
Using Rate Limiting�������������������������������������������������������������������������������������������243
The Fixed Window Model�����������������������������������������������������������������������������246
The Sliding Window Model��������������������������������������������������������������������������253
The Token Bucket Model�����������������������������������������������������������������������������255
The Concurrency Model�������������������������������������������������������������������������������257
Global Error Management���������������������������������������������������������������������������������259
Summary����������������������������������������������������������������������������������������������������������266

v
Table of Contents

Chapter 6: Accessing Data Safely and Efficiently�����������������������������267


Introduction to Data Access Best Practices������������������������������������������������������267
SQL-Type Data Access���������������������������������������������������������������������������������268
HTTP Data Access����������������������������������������������������������������������������������������269
Architecturing Data Access�������������������������������������������������������������������������269
Accessing Data with Entity Framework Core 8�������������������������������������������������271
Step 1: Creating the CountryEntity Class�����������������������������������������������������272
Step 2: Creating the EF Core Context����������������������������������������������������������273
Step 3: Configuring the CountryEntity���������������������������������������������������������274
Step 4: Generating the Database Model from C#����������������������������������������276
Step 5: Enabling Resiliency with Entity Framework Core����������������������������280
Step 6: Writing the Repository on Top of the CountryEntity�������������������������281
Accessing Data with HttpClient and REST APIs�������������������������������������������������294
Using IHttpClientFactory to Make HTTP Requests���������������������������������������295
Using Refit to Make HTTP Requests������������������������������������������������������������297
Using Polly to Make HTTP Requests Resilient���������������������������������������������298
Summary����������������������������������������������������������������������������������������������������������301

Chapter 7: Optimizing APIs���������������������������������������������������������������303


Asynchronous Programming�����������������������������������������������������������������������������303
Basics of Asynchronous Programming��������������������������������������������������������304
Using CancellationToken�����������������������������������������������������������������������������306
Long-Running Tasks with Background Services�����������������������������������������������310
Paging���������������������������������������������������������������������������������������������������������������321
JSON Streaming������������������������������������������������������������������������������������������������324
Caching�������������������������������������������������������������������������������������������������������������326
Output Cache�����������������������������������������������������������������������������������������������326
In-Memory Cache����������������������������������������������������������������������������������������330
Distributed Cache����������������������������������������������������������������������������������������336

vi
Table of Contents

Speeding Up HTTP Requests with HTTP/2 and HTTP/3�������������������������������������342


Summary����������������������������������������������������������������������������������������������������������343

Chapter 8: Introduction to Observability������������������������������������������345


Basics of Observability��������������������������������������������������������������������������������������346
Performing Logging������������������������������������������������������������������������������������������347
Performing Tracing and Metrics Data Collection�����������������������������������������������363
Implementing HealthCheck�������������������������������������������������������������������������������367
Liveness HealthCheck���������������������������������������������������������������������������������368
Readiness HealthCheck�������������������������������������������������������������������������������370
Summary����������������������������������������������������������������������������������������������������������374

Chapter 9: Managing Application Secrets����������������������������������������375


Introduction to Application Secret Management�����������������������������������������������375
Example with Azure Key Vault���������������������������������������������������������������������������378
Summary����������������������������������������������������������������������������������������������������������383

Chapter 10: Secure Your Application with OpenID Connect��������������385


Introduction to OpenID Connect������������������������������������������������������������������������386
Configuring Authentication and Authorization in ASP.NET Core������������������������389
Passing a JWT into Requests and Getting the User’s Identity���������������������������395
Summary����������������������������������������������������������������������������������������������������������401

Chapter 11: Testing APIs������������������������������������������������������������������403


Introduction to Testing��������������������������������������������������������������������������������������403
Efficient Unit Testing�����������������������������������������������������������������������������������������405
Using the Right Tools�����������������������������������������������������������������������������������406
Testing a SUT Step-by-Step�������������������������������������������������������������������������408
Summary����������������������������������������������������������������������������������������������������������418

Index�������������������������������������������������������������������������������������������������419

vii
About the Author
Anthony Giretti is a senior developer/architect
at Marchex in Toronto, Canada. He appreciates
learning and teaching new technologies and
has a knack for web technologies (more than
17 years’ experience) and a keen interest in
.NET. His expertise in development and IT and
his passion for sharing his knowledge allow
him to deconstruct any web project in order
to help other developers achieve their project
goals. He loves to deal with performance constraints, high availability,
and optimization challenges. Anthony is the author of Beginning gRPC
with ASP.NET Core 6 (Apress), a six-time Microsoft MVP, and a Microsoft
Certified Software Developer (MCSD).

ix
About the Technical Reviewer
Fiodar Sazanavets is a Microsoft MVP and a
senior software engineer with over a decade
of professional experience. He primarily
specializes in .NET and Microsoft stack and
is enthusiastic about creating well-crafted
software that fully meets business needs.
He enjoys teaching aspiring developers and
sharing his knowledge with the community,
which he has done both as a volunteer and
commercially. Fiodar has created several
online courses, written a number of technical books, and authored other
types of educational content. He also provides live mentoring services,
both to groups and individuals. Throughout his career, he has built
software of various types and various levels of complexity in multiple
industries. This includes a passenger information management system
for a railway, distributed smart clusters of IoT devices, ecommerce
systems, financial transaction processing systems, and more. He has also
successfully led and mentored teams of software developers.

xi
Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
Acknowledgments
Completing this book could not have been possible without the
participation and assistance of many people, and I would like to express
my special thanks to them. First, thanks to my wife, Nadege, who never
stopped supporting me. I love you!
Next, I would like to thank the rest of my family for their support.
This book has been written in special conditions since I was
hospitalized for a severe disease that could have taken my life. I haven’t
given up, and I hope this book will please you; if I have completed it, it’s for
a good reason, I hope!
I also would like to thank my colleagues at Marchex, especially
my friend (and colleague) Callon Campbell, who never stopped
encouraging me.
Thanks to my friend Dominique St-Amand, who has never been stingy
with comments to help me improve this book.
Last but not least, Fiodar Sazanavets! Thanks, my friend, for being part
of this journey; you were essential in this new challenge I set for myself.
Without you, I wouldn’t have succeeded.

xiii
Prerequisites
This book is aimed at beginner and intermediate developers who want to
take their Application Programming Interface (API) development skills to
the next level. In this book, I assume you know the basics of .NET, C#, and,
therefore, the fundamentals of Object-Oriented Programming (OOP). I
also assume you’ve already used Visual Studio and know how to use it. As
for web fundamentals, I’ve started from scratch, so if you don’t know much
about the Web, no problem!

xv
Introduction
Dear reader friend, welcome to this book!
In my career, I have worked in various companies and on various
complex APIs. Although each company had its challenges, I can assure you
that they all had one thing in common: their APIs lacked a lot of love and
care. They all suffered from the same problems: poor code organization
due to an accumulation of minor errors over the years, lack of consistency
in the definition of coding conventions, lack of technological refreshment,
misinterpretations of the HyperText Transfer Protocol (HTTP) and
Representational State Transfer (REST) principles, missing logging or bad
logging practice, and not enough care regarding performances.
I have always enjoyed helping teams overcome these difficulties,
and I have decided to write a book to share my experiences and guide
you through the best practices of API implementations. This book will
focus on some technical architecture of an API, but it will focus more on
coding practices to help you avoid the most common mistakes in your
development career. I will not cover solution architecture where an API
is built around other systems, but keep assured; I will show you how to
implement access to external data sources.
At the end of this book, you will know how to develop APIs with ASP.
NET Core 8 properly coded, performant, resilient, secure, testable, and
debuggable. You will go from a beginner/intermediate level to a senior
level by learning precisely WHAT you need to know without feeling
overwhelmed by a ton of information.

Let’s go!

xvii
CHAPTER 1

Introducing HTTP
and REST
Before we dive into ASP.NET Core 8 and API development, let’s first go
back to the basics of any web application. Whether a website is run from a
browser or a web service (web API), it’s always the same principle: a client
and a server will communicate together; a client will send a request to a
server, which will then respond to the client. This is all possible with the
magic of the HTTP communication protocol. Under this protocol, data
can be transported using different formats and constraints. Here is REST!
REST is an architectural concept of data representation. Of course, these
two should not be confused. In this chapter, we will cover the following
content:

• HTTP

• REST architecture style

Unveiling HTTP Behind the Web


The HyperText Transfer Protocol (HTTP) is a network protocol for
exchanging data between clients and servers. This protocol was invented
in 1990 by British computer scientist Tim Berners-Lee to access the World
Wide Web (WWW). WWW makes it possible to consult web pages from

© Anthony Giretti 2023 1


A. Giretti, Coding Clean, Reliable, and Safe REST APIs with ASP.NET Core 8,
https://doi.org/10.1007/978-1-4842-9979-1_1
Chapter 1 Introducing HTTP and REST

a browser using HyperText Markup Language (HTML) through Uniform


Resource Identifier (URI) web addresses. At the beginning of HTTP’s
history, HTML was the language used to create pages, but since then,
HTTP has evolved into a web server that can process data formats other
than HTML. For example, a web server can serve (but also accept as input)
Extensible Markup Language (XML), which is a structured language, or
JavaScript Object Notation (JSON). Of course, a web server can serve other
types of data formats, categorized as Multipurpose Internet Mail Extensions
(MIME) type, and I will come back to this later.
HTTP follows a technical specification called Request From Comment
(RFC), developed by the Internet Engineering Task Force (IETF). There
are a ton of RFC specifications identified by numbers. The common point
among them is that they define the specifications of the Internet and only
the Internet. HTTP is defined by RFC 7231. RFC 7231 can be found at this
address: www.rfc-editor.org/rfc/rfc7231.

Note In this book, I will often refer to RFCs. The reason is that I
want to teach you the good practices for using HTTP. However, in
practice, the actual implementation of those RFCs may differ. Finally,
while this chapter aims to teach you the good techniques with HTTP,
I will not cover all the HTTP capabilities. I’ll stick to what you need to
know about building clean APIs with ASP.NET Core.

There are also different versions of HTTP. HTTP has evolved. I will not
go into details; in the following, you can find the published versions of the
protocol:

• HTTP/0.9 (obsolete)

• HTTP/1.0 (obsolete)

• HTTP/1.1 (still used)

2
Chapter 1 Introducing HTTP and REST

• HTTP/2 (in use but not widely used)

• HTTP/3 (new, not much used)

In this book, I will mainly refer to HTTP/1.1 and sometimes to HTTP/2


and HTTP/3 (when approaching the performance theme).

The Characteristics of HTTP


HTTP has three essential characteristics:

1. It is stateless: This means that after sending a


request to the server and receiving the response,
neither the client nor the server retains any
information on the exchanged request.

2. It is connectionless: An HTTP connection is open


between the client and the server. Once the client
has received the response from the server, the
connection is closed, and the connection between
the two systems is not permanent.

3. It is independent of the media, that is, the server


can transmit any media as long as the client and
the server “agree” on exchanging the content. (I will
return to this when I discuss headers.)

While HTTP is stateless, transmitting information between requests


may be necessary. Most web applications need to recognize the same
user during a browsing session (identify this user through browsing
between several web pages). To achieve this, an RFC describes HTTP
cookies designed to keep user data browser-side. I won’t go into this type
of “persistence” in this book, but I will employ more modern techniques.
However, if you are interested, consult RFC 6265 here: www.rfc-editor.
org/rfc/rfc6265.

3
Chapter 1 Introducing HTTP and REST

These characteristics may seem abstract, but they will become more
apparent as we read this book together. In the next section, I will give
you an overview of HTTP requests and responses. This will help you
understand HTTP before going into detail.

HTTP Requests and Responses


An HTTP connection works as follows: a request will receive a response
unless the connection is broken. Every request and every response works
the same way, and I’ll go into more detail in the next section.
An HTTP request works with elements as follows:

• A client (a browser, an application) initiates an HTTP


request by invoking a URI, the address of the requested
resource on the server.

• The URI requires the use of a verb that will determine


the action to be performed.

• Metadata will be sent in the HTTP request, called


headers. These headers allow controlling the
content negotiated with the server, such as sending
authentication information and much more.

• Parameters are necessary to exchange content with


the server and obtain the response sought, and the
parameters can be in the request’s body, the route, or
the URI.

An HTTP response works with elements as follows:

• The server returns a response with a simple status


code (HTTP status code) to determine how the HTTP
request processing took place.

4
Chapter 1 Introducing HTTP and REST

• The server also returns headers in response to the


client providing with different metadata.

• Finally, the server will return (or not) a payload


formatted in the MIME type requested by the client.

So far, I have briefly described and simplified how HTTP works.


Figure 1-1, therefore, summarizes what we have previously discussed.

Figure 1-1. A basic HTTP request and its response

In the following section, I will detail the HTTP verbs, the request
headers, the format of a URI, the different parameters passed in a
request, the HTTP status codes, the response headers, and the payload
formats returned to the client. Once we finish those points, I will bonify
Figure 1-1 with more details.

HTTP Implementation
Let’s dive into more detail to see what HTTP verbs, request headers,
response headers, and HTTP status codes are and how the client passes its
parameters in HTTP requests combined with the invocation of a URI.

5
Chapter 1 Introducing HTTP and REST

HTTP Verbs
RFC 7231 defines the following verbs:

• GET: This is the most well-known. It allows you to


request a resource from the server and receive a
response in the desired format (defined by the headers,
as we will see later in this chapter). The response is
cacheable (retain information in memory), and we will
discuss it in Chapter 6.

• HEAD: This verb is similar to the GET verb but does


not return any payload; a payload is used to request
metadata at the requested address. Since developers
barely use it most of the time, I won’t use it in this book,
but it’s good to know what it is used for. Like GET, the
server response is also cacheable.

• POST: This verb is interesting because it serves


multiple purposes. This verb allows the creation of new
resources, and its payload is attached to the request’s
body. (I will detail what’s a request body further in
this chapter.) Another way to send data is to use the
form-data technique, which will be described later in
this book. The POST verb also allows modifying data
by adding content to the data (appending data to the
resource representation according to the RFC). The
server response is not cacheable unless freshness
information is added to the response headers (max-­
age or Expires headers). We will discuss it again in the
“Request and Response Headers” section.

6
Chapter 1 Introducing HTTP and REST

• PUT: This verb is confusing because the RFC states


that it replaces a resource on the server. Very often,
developers confuse PUT and POST (replace a resource
vs. append data to a resource). The server response
here is not cacheable. However, if a resource doesn’t
exist, PUT should behave as POST by creating the
resource.

• DELETE: This verb is used to delete a resource. The


server response is not cacheable.

• CONNECT: The verb establishes a tunnel to the


server through a proxy (a server to which the HTTP
request will be delegated and access the server for
the requested request). This verb is used for secure
requests with Transport Layer Security (TLS), in other
words, HTTPS. I will also come back to HTTPS later in
this chapter. I never had to use this verb, and I won’t
talk about it in this book. The server response is not
cacheable.

• OPTIONS: This verb can be helpful when you want to


know what verbs are supported for a given URI. It’s also
used in the context of Cross-Origin Resource Sharing
(CORS), which has its dedicated section further in
this book. In the API world, you don’t necessarily
need to use this verb because you will usually know
the available URI for a given endpoint through the
OpenAPI specification. This will be discussed in the
“Extend Your Talent on the Web with REST Architecture
Style” section of this chapter. We will also see it together
in Chapter 4 when I bring up the API documentation
topic. The server response is not cacheable.

7
Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
Other documents randomly have
different content
Naida received me very graciously on the following afternoon. I was
a little surprised that she had made no attempt whatever to alter her
surroundings or in any way to create an atmosphere. The ordinary
hotel furniture and hangings were lightened only by a profusion of
flowers, mostly deep red roses. In place of the flowing robes one
might have expected, the great dancer wore a severe tailor-made
costume of grey tweed. Her hair was brushed plainly back from her
forehead and tied with ribbon behind. There was no other caller
present when I arrived.
"It would be charming of you to come so soon," she murmured, as
she held out her hand, "if it were your own will which brought you."
"My own will would have brought me here in any case," I assured
her, "but as it happens I have another mission. I am to ask you what
has become of Felix Worth."
I looked into the eyes of another woman for a moment, and I was
afraid. Her momentary fit of fury, however, passed. She motioned
me to a chair.
"How much do you know of this matter?" she asked.
"Nothing at all," I answered promptly.
"That is the way with him," she ruminated. "His agents never know
anything."
"That does not, I trust, prevent my finding great pleasure in making
your acquaintance, Mademoiselle," I ventured.
She looked at me curiously. Sixty seconds ago I should have
described her as being, off the stage, disappointedly plain. I realised
my mistake.
"It does not prevent your paying me any compliments you choose,"
she replied. "There is no reason why we should not be friends—even
comrades. The only cloud between us appears to be that it will fall
to your lot to kill the only man I have ever really cared for."
I started in my chair.
"I can assure you," I told her, "I am not out for that sort of thing at
all."
"But it will come," she persisted.
"It will not," I contradicted her firmly. "I have done all the killing I
want to, in fair fighting. I have a weakness for adventures, but
nothing would induce me to become an assassin."
She looked at me contemplatively, leaning across from her chair with
her chin balanced upon her hands. Then she got up and brought me
a queer round wooden box of fragrant Russian cigarettes. She
herself lit one, and I followed her example.
"Are you afraid, dear earnest Englishman," she asked, "that I should
hate you? Let me tell you the truth. For this man I have no love any
more. And he must die."
"He may live or he may die," I answered, "but I am no man's
executioner."
"We shall see," she remarked indifferently. "You are a just man,
beyond a doubt, but I like you. You are different from all others."
"In what respect?" I enquired.
"I admit you here," she replied, "to the intimacy of a private visit,
yet you have not yet suggested that you should become my lover. It
intrigues me, this diffidence."
I felt a sudden desire to get out of the room. She laughed at me,
laughed with simple, unaffected mirth, laughed till she came over
and laid her hands upon my shoulders.
"Go away, dear man," she begged, "before I make myself foolish
about you. You shall sit at my side to-night, and perhaps then, when
you see what others think of me, you may whisper different things."
"And where do I sit by your side to-night?" I asked.
"You and your two friends," she said, "sup with me in the restaurant
downstairs at midnight. Convey my compliments and this invitation
to your charming lady companion. I shall see her at the theatre and
will confirm it."
She gave me her fingers and held them for a moment against my
lips. Then I went out, a little dazed.
I began to fear that Naida was going to make trouble for me. At the
theatre that evening she demanded my constant attendance. Twice
she sent notes to my dressing room, and in the midst of the
tumultuous applause which followed her wonderful dancing, when
she stood in the wings with us after her seventh recall, she tore one
of the red roses which had been thrown on to the stage from its
cluster, and thrust it in my buttonhole.
"So!" she whispered. "They will know from whom that rose comes.
Your fingers will caress it when you sing. They will applaud you the
more for my sake."
This was all very pretty and soothing to my vanity, and, I frankly
admit, in its way pleasant, but I had all the time the feeling that it
was likely to bring trouble upon me. When, in her most charming
manner, Naida had issued her invitation to Rose, her enthusiastic
acceptance was entirely marred for me by the manner of it.
"A supper party will be perfectly delightful," Rose declared, smiling
with dangerous sweetness. "I have a little headache to-night but
that will pass. In any case you will not mind if Leonard—if Mr. Cotton
should bring me away early."
"So long as you do not rob me of my dear cavalier," Naida replied, to
my dismay, squeezing my arm.
I marched Leonard on one side, taking advantage of the insistent
roars of recall which drew Naida back on to the stage.
"Look here, Len," I said, "I don't know what this game is, but I'm
playing it for the three of us. I am obeying orders so far as
Mademoiselle Naida is concerned. If Rose won't see it, I shall rely
upon you."
"I'll do my best, old chap," he promised, with a gloom which I
fancied was not altogether natural. "It's a jolly hard situation,
though. Rose had asked me to take her out to supper to-night, and
to dinner on Sunday night."
"You can count that dinner off," I said firmly. "We three have dined
together every Sunday night since we started out. Sometimes it's
been a scrag of mutton and a glass of beer; once or twice—that
week at Cromer, Len—not even that. On Sunday night it's going to
be caviare and a Maryland chicken, and I'm in it."
"That's all right," Leonard assured me. "Of course, Rose thought that
you'd be in attendance on Naida."
"You and I won't have any misunderstanding, at any rate, Len," I
insisted. "Naida means just as much to me as that bit of fluff on your
coat. When our year is up, I shall ask Rose to marry me, and though
you're the dearest fellow in the world, I hope she'll have me and not
you."
"I sha'n't take advantage, old chap," Leonard promised, with a sigh,
"but it's getting filthily difficult. She pretended she wanted me to kiss
her last night."
"I'll punch your head if you do," I answered savagely. "Our call."
The supper party did not improve matters. We found quite a
distinguished little gathering in the foyer of the Milan, including the
managing director of the Parthenon, some of the best known
dramatic critics, a famous actor and his wife, another and a lady
who might have been, a foreign ambassador, and two other well-
known and distinguished men about town. Naida did her duty by
placing a very distinguished nobleman with cosmopolitan tastes
upon her right, but, to my secret dismay and the wonder of the rest
of the company, she insisted upon my occupying the seat on the
other side of her.
"Now," she whispered, looking at me from under her eyelashes with
that slow, curious smile upon her lips, "I have made the little lady
jealous, is it not so? And also the great managing director who pays
me my salary, and perhaps others. But what does it matter? You are
content?"
The lie came uneasily from my lips. Naida, however, seemed
satisfied. It was borne in upon me now that it was her deliberate
purpose, part of the game, in fact, not only to exploit me as a victim
of her charms but to practically advertise her simulated infatuation. I
watched Rose flirting desperately with a very attractive man who
was seated upon her left, and for a moment I felt that the situation
was impossible—that I should do best to mutter a few plain words to
my hostess and deliberately dissociate myself from the rôle into
which I had drifted. Then I remembered our chief's confidence—
Naida spoke to me with unexpected kindness. I caught the echo of
Rose's unnecessarily joyous laughter, and I changed my mind.
Thenceforth I played my part. I lent myself to the gaiety of the
moment. We were all young together. The wine was good, life was
good, the very music seemed playing us down the avenues of
pleasure. From a gay party we became almost an uproarious one.
We moved outside into the lounge for our coffee, Naida never letting
me for an instant leave her side, relegating to me the duties of host,
thrusting her pocketbook into my hand, insisting that I should order
the cigars and liqueurs, fee the waiters, and even sign the bill on her
behalf. There were many smiles amongst the little company, shrugs
of the shoulders, and whispered enquiries as to my identity. My
fictitious position seemed to make me an object of envy, but I never
altogether lost my head. I waited for my opportunity, and when it
came I rose quickly to my feet and walked over to Rose's side. Her
companion of the moment had been summoned away to speak to
some acquaintances in another part of the lounge.
"Rose," I began sternly——
She looked at me with a bright but artificial smile. I leaned down
and continued under my breath.
"I play the buffoon to order," I reminded her. "You, too, have your
part in this."
"Indeed?" she murmured.
"Yes! Your part is not to make mine more difficult. Your part is to
remember——"
Then I stopped short. It was a difficult position. There was my
contract with Leonard to be borne in mind.
"To remember what?" she asked, looking at me more naturally.
"The things of which your heart assures you," I answered. "I am
only human. If I fail to-night, the fault will not be wholly mine."
After that there was a change in Rose's demeanour, and once, when
our eyes met, she smiled. Naida, however, still played her part of
sorceress. She seemed impatient of every word she was forced to
speak to others. She whispered often in my ear. Even her fingers
sought mine. It was just at this stage that for the first time I noticed
the somewhat singular appearance of a man who was watching us
from the few seats upstairs reserved for guests of the hotel who
were not in evening dress. As though he sought concealment, he
had found a chair in the most remote corner and was half hidden by
a slight projection of the wall. He had a mass of black hair, a heavy,
sallow face, from which one formed the idea that he had recently
removed a beard, and dark staring eyes. He was untidily dressed for
his surroundings, amongst which he seemed curiously out of place.
An impulse prompted me to point him out to Naida. She glanced in
the direction I indicated but merely shrugged her shoulders.
"Dear friend," she whispered, "you forget that I am a famous
person, more so abroad than in your little island. There are many
who watch me with thoughts in their heart which they will never
dare to utter. There are many who would give a share of their
possessions to be seated where you are seated, to be treated as I
am treating you."
"The man is a foreigner, without a doubt," I remarked.
"And foreigners," she answered, with a stabbing little glance, "are
quicker to feel and understand than Englishmen."
We kept the party going until long past closing time, and then an
adjournment of our diminished numbers was made to Naida's suite.
Here she distributed signed photographs to her remaining guests,
accompanied by a wave of the hand which meant dismissal. Rose
and Leonard were amongst the first to leave, Rose with a look in her
eyes which might have meant anything. I stepped quickly forward.
Naida looked at me warningly. Now that we had left the lounge, it
seemed to me that her demeanour had to some extent changed.
"For your impatience, Monsieur Maurice," she said, "you will be the
last. Offer the cigarettes, if you please. And your friend Mr. Cotton,
will he not take a whisky and soda before he goes?"
One by one they drifted away. Rose and Leonard were driven home
by one of the former's new admirers. The time came when we were
alone. Naida listened to the closing of the door and to the clanging
of the lift gate. Then with her back to the table against which she
was leaning, she looked across at me with an odd little smile upon
her lips.
"So we are alone, my friend."
"It has that appearance," I admitted, taking one of her cigarettes
and lighting it. "I await your further instructions."
She nodded her head slowly. She seemed to be considering my
attitude.
"My further instructions," she mimicked. "Oh, Monsieur Maurice,
what a strange person! Ring the bell on your left, please."
I obeyed. A maid presented herself at once from the inner room.
Naida spoke to her for a moment in some weird language. Then she
turned towards me, yawned and stretched herself.
"Prepare for a shock," she said. "For ten minutes I leave you. You
seat yourself in that easy chair, you take a whisky and soda and the
evening paper, you make yourself at home. You understand?"
"Perfectly," I answered, not at all sorry for a few minutes' solitude.
"Then au revoir! But have no fear," she added, looking back with a
mocking smile, "I shall return."
A quarter of an hour or so passed. I heard Naida telephoning from
her bedroom and heard her voice in conversation with her maid.
Then she reappeared. She was wearing a yellow creation tied
around her with a girdle, Chinese sandals tied with broad yellow
ribbon; and her unloosed hair was gathered together with ribbon of
the same colour. She displayed herself for my admiration.
"You admire, Monsieur Maurice? You like the colour?"
"You look charming," I replied. "And now?"
She held up her finger.
"You are not to stir," she directed, waving her finger at me.
She moved towards the door which led into the corridor, opened it
softly and peered outside. Then, as though not satisfied, she
disappeared altogether. When she returned, she closed the door with
a little slam and threw herself into a chair opposite to me.
"And now?" I repeated patiently.
"It is the hardest part of your task, this, Monsieur Maurice," she said,
with a demure little droop of the eyes. "You see the time? It is
exactly two o'clock. For one hour you remain where you are. At the
end of that hour you are free. You may then leave, and, if you wish
it so, your courtship of Naida is over."
"And for that hour?" I asked, a little unsteadily.
She came and sat on the arm of my chair. Her face was upturned to
mine.
"Shall I keep you company?" she whispered.
I leaned down and took the kiss she offered me. I held her for a
moment in my arms. Then I gripped her wrists.
"Naida," I said, and my own voice sounded to me unfamiliar, "of
course I know this is a game, but I don't understand the rules."
"We make them," she murmured.
"I am in love with Rose Mindel," I continued. "I should be married to
her at the present moment but for a stupid agreement between
Leonard Cotton and myself, made when we three started out
together. I am in love with her, but I'm no Joseph. You know what
you are, and your power. I'm not any different from other men."
"But you do not care, then?" she asked quickly.
"There isn't any ordinary young man of my type," I answered, "who
has drunk your wine and sat by your side all the evening, and
received your kindness, and finds himself here alone with you, who
wouldn't care—in a way—the wrong way. I care like that, if it's any
good. And now you understand."
She slipped from her place, kissed me on both eyes, and ran across
to the door of the inner room. She looked back at me only for a
moment, opened her lips, said nothing, and disappeared, closing the
door softly behind her. I mixed myself the stiffest whisky and soda I
had ever concocted in my life, lit a cigar from a box I found on the
sideboard, and sat down to watch the clock.
At five minutes to three, I was walking up and down the room with
my overcoat on. At a minute to the hour, as I stood with my eyes
glued to the clock, the inner door softly opened. Naida stood framed
upon the threshold. There was a look of distress upon her face.
"Monsieur Maurice," she said, "I had made up my mind to say
nothing, but that was wrong. You are a very honourable young man
and I have not met many. It has been promised to me that no harm
shall come to you, but yet—go warily to the lift."
She disappeared and closed the door. For the first time she locked it.
Somehow, I felt, as I stepped out into the corridor, that the dangers
which might be waiting for me were small things. I stood for several
seconds, looking up and down. To reach the lift I had to traverse the
whole of the corridor, turn to the left and pass along another shorter
one. I stepped out carelessly enough, and then—the scantily lit
passage seemed suddenly filled with whispering voices, with eyes
peering at me from mysterious corners; the soft carpets behind me
were reverberant with muffled and stealthy footsteps. I was acutely
conscious of the presence of danger. As I neared the corner of the
corridor every nerve of my body was bristling with apprehension.
Before I turned, I paused for a moment and looked behind. There
was only a single electric lamp burning, but I could see dimly along
the empty space to the end. There was no sign of any moving
figure, nor any sound. Then I turned the corner to find myself
suddenly seized in a pair of giant arms, the dull flicker of upraised
steel before my eyes, the sallow, brutelike face, the black, flaming
eyes of the man who had watched me from the lounge, within an
inch or two of me.
I had no chance to call out. My assailant's left hand was upon my
throat. I could see him gathering strength to drive that knife down
into my heart. My brain was perfectly active. I waited with tense
muscles for the terrible moment, meaning to fling myself on one side
in the hope that I might escape mortal injury from that first blow, at
any rate. And then I saw something loom up behind. I saw an arm
raised even higher than my captor's, and I heard the wickedest
sound in life—the crash of dull metal into a man's skull. The grasp
upon my throat was instantly relaxed, doors were thrown open along
the corridor, and I sank back into a momentary fit of
unconsciousness.

If our customary supper party with Mr. Thomson lacked some of


those qualities which in the earlier days of our adventures had made
it so wonderful a thing, the change of venue, and our host's curious
genius in devising new dishes, still contrived to make the occasion a
memorable one. We met this time in a private room at the Hotel
Albion at Brighton, whither a telephone message had summoned us
earlier in the day. Mr. Thomson, spick and span as ever, looking in
the pink of condition, commended to us the best oysters in the world
and sipped almost reverently the contents of a dust-covered bottle
of Chablis.
"I am not sure," he told us, with the air of one imparting grave
knowledge, "that in these days it is not possible to find better
vintages out of London than one comes across even in the
restaurants de luxe. This wine, for instance."
"The wine is wonderful," Rose agreed. "These oysters are wonderful,
too, and I never saw such a lobster mayonnaise as that upon the
sideboard. But, dear Mr. Thomson, if you expect us to enjoy our
supper, do be merciful. There will be no waiter in the room for at
least five minutes. Give us some idea as to the meaning of this last
adventure."
Mr. Thomson smiled benevolently.
"Why not?" he said. "Here is the story in a very few words. There
was in London, ten days ago, the most dangerous anarchist and
political disturber of the peace in Europe. His name is a household
word to all of you. He passed here as Paul Kansky."
"Naida's lover," I ventured.
"As a matter of fact, her husband," Mr. Thomson explained. "His
removal was absolutely necessary for the internal peace of this
country. There were a hundred charges on which he could have
been arrested, but not one for which he could have been safely put
out of the way. Being at times open to accept a contract of this
nature, I undertook to dispose of him."
I shivered a little as I listened. Mr. Thomson continued very much as
though he were referring to some ordinary commercial undertaking.
"Kansky's one weakness was Naida Modeschka, his one passion
jealousy. With the aid of our young friend here, I succeeded in
fanning that passion into a red-hot flame. I succeeded, too, in
engineering such an attempt at wilful murder on the part of Kansky
that his own demise, owing to the apparently accidental intervention
of a casual rescuer, seemed to occur quite naturally. You behold the
result of an exceedingly well-laid scheme. This mischievous person is
dead and buried under the name he bore at the Milan Hotel, and
which the great world of his followers does not recognise."
"Then my rescuer," I exclaimed, "John P. Martin, the American Oil
Trust man——"
"Precisely," Mr. Thomson interrupted. "Mr. Martin was my agent, a
man of iron and a professional fighter, planted in room number
eighty-four, with instructions to intervene on your behalf in such a
way that Kansky could give no more trouble."
"And those other two men who gave evidence—the witnesses?"
"Also arranged for," Mr. Thomson acknowledged. "It was really a
very well-planned affair. The man Kansky's passion for Naida was
proved by the letters produced in court. His attack upon our young
friend here provided ample excuse for Mr. Martin's vigorous action.
The witnesses, of course, were able to declare that Kansky was in
the act of committing a probable murder, and that Martin's contra
attack, with its unfortunate results, saved your life."
"And Naida?" Rose enquired.
Mr. Thomson smiled.
"How should we be able to deal with these little affairs," he
observed, "but for the vagaries, my dear Miss Mindel, of your
wonderful sex? Naida was a very willing accomplice in our little
scheme. For seven years in a brutalised Russia she had lived under
that man's dominance. When she was fortunate enough to escape
over here, it was certainly not with the idea of again submitting to it.
I hear the waiter. Any more questions?"
"For whom were you acting?" I asked eagerly. "How did this affair
come into your hands?"
Mr. Thomson seemed to be listening to the roar of the sea, which
came to us pleasantly through the open window.
"Ah!" he murmured. "That again is a question the answer to which I
fear must be postponed. Shall we call it Conundrum Number Four?"
CONUNDRUM NUMBER FIVE
THE TRAGEDY AT GREYMARSHES
"Spring," Leonard declared, fanning himself with his straw hat and
breathing in the ozone from the waves which rippled up to within a
few yards of our chairs, "is upon us."
"I must get some new frocks," Rose murmured absently.
"To-morrow," I reflected, "I must go through my tennis flannels."
"Jolly good-looking girl that was with the party from the Grange at
the show last night," Leonard continued reminiscently. "I liked the
way her eyelashes curled. Jolly fine figure, too."
"The tutor man is quite handsome," Rose ruminated. "He ties his
black evening bow just the way I like."
"Handsome!" I scoffed. "Why, he's got a cast in his eye! He reminds
me, more than anything, of the plaster villains in the Chamber of
Horrors at Madame Tussaud's."
"I didn't notice any cast," Rose sighed, her eyes turned dreamily
seawards. "He looked at me hard enough, too, when I was dancing."
"They're a strange crew at the Grange," I observed, lighting a
cigarette from the case which Leonard had thrown me. "I can't
altogether size them up."
Rose turned towards me reproachfully.
"You are becoming obsessed, Maurice, with your love of
adventures," she complained gently. "You think of nothing else.
Surely, in this dear, old-world place we can have a little rest; we can
drop the tenseness of the last few months and become just simple,
natural human beings again."
"The chief didn't send us down here for nothing," I ventured.
"Don't forget," she reminded me, "that at our last supper at Brighton
I begged for a little rest. Only a few weeks afterwards, he sent us
here. I am quite certain that nothing ever happened at
Greymarshes. If we get into any trouble here, it will simply be
because the spring is so disturbing."
She looked at me lazily, almost affectionately. Then she looked at
Leonard. His hat was tilted over his eyes and his hands were clasped
around his knees. There was very little of his good-natured, pudgy
face to be seen.
"I wonder," she continued, with a little sigh, "why neither of you ever
make love to me. I'm very attractive."
"The situation," Leonard began, taking his hat off and sitting up——
"Oh, hang the situation!" Rose interrupted irritably. "If you can't
make up your minds which of you it is to be, you might toss up or
something. Here's spring coming on. I'm twenty-two years old, and I
haven't got a young man. You will drive me to answer some of the
desperate notes which are showered upon me by lovesick youths
from the front row. I had another last night from Arthur. I believe
that he really loves me."
"I'm afraid Arthur will have to be spanked," I said.
Rose made a little grimace.
"There is such a thing, Mr. Maurice Lister," she declared, "as playing
the watchdog just a little too zealously—especially in the springtime.
See who's coming. I think I shall turn round and smile."
We both looked along the sands in the direction which she had
indicated by her parasol. A tall, weedy young man, dressed with the
utmost care in a grey flannel suit, brown shoes and linen spats, a
Panama hat and a quaintly impossible tie, came slowly towards us,
swinging a stick in his hand. As he drew near, he diffused
multitudinous odours. His pimply face was suffused with a deep flow
of colour. We realised at once what was going to happen. The young
man whom we knew by repute only as Mr. Arthur Dompers,
established at the Grange with a tutor and a small company of
satellites, had evidently made up his mind to speak to us.
He came to a standstill, sidled round to the front of us, and raised
his hat.
"Good morning! I say, you'll forgive my saying so—what? Awfully
jolly show of yours! Ripping!"
Now I cannot say that any of us took to this young man, and,
considering our Bohemian manner of life, we none of us had a fancy
for chance acquaintances. The gentle rebuke which we had
meditated, however, died away, first on Rose's lips and then on
mine. It became apparent to us that the boy was horribly nervous.
"Glad you like it," I rejoined.
"So nice of you," Rose murmured.
"Quite a crowd from your place last night, wasn't there?" Leonard
observed.
"That's right," the young man acquiesced. "We all weighed in—had
dinner early on purpose. Jolly place you've got here."
"Won't you sit down?" Rose invited.
The boy squatted promptly at her feet. He wore pink socks and he
reeked of scent, yet there was something a little pathetic in his
obvious desire to be friendly.
"Are you cramming for anything in particular?" I asked him.
"I was supposed to go in for the Army," was the dubious reply, "but
the exams are so jolly difficult. I failed for Sandhurst twice. Now
they're trying to get me in at Cambridge so that I can join a cadet
corps."
"The exams are so much stiffer since the war," Rose remarked
consolingly.
"Are any of your people down here with you?" I enquired.
The boy shook his head.
"I haven't any people to speak of," he confided, "except an uncle I
have scarcely ever seen. Another uncle—my father's brother—left
me all my money. Sometimes," the young man added, with a queer
flash of seriousness which made one forget his socks and his tie and
his pimples, "I wish he hadn't."
"It must be awfully nice, though, to feel that you've plenty of time in
life for games and all that sort of thing," Rose remarked, with a mild
attempt at consolation.
"I'm not very good at games," the young man confessed. "Mr.
Duncombe and his friends are so much better than I am, and they
always laugh at me."
"That is a very untutorlike thing to do," Rose declared indignantly.
The young man looked frightened.
"Mr. Duncombe is very good to me—very kind indeed," he repeated,
in parrot-like fashion.
"Is he?" Rose queried drily.
"He has no end of people down so that we shouldn't be dull," the
young man went on. "There's his sister—she's very kind to me, too.
I think I shall have to marry her."
"Why?" Rose asked in bewilderment.
"I think Mr. Duncombe would like me to," was the resigned reply. "I
am very fond of Ella. She sings and dances beautifully."
"How old are you?" Rose enquired.
The boy seemed on the point of making another parrot-like reply.
Then he chanced to meet the kindly expression in Rose's face as she
leaned towards him. He hesitated.
"There's a sort of secret about my age," he confided. "Mr. Duncombe
likes me to tell every one that I am twenty."
"And aren't you?" I asked curiously.
He shook his head.
"I shall be twenty-one on Saturday," he said. "I shall be able to sign
cheques of my own then—and make my will."
"What do you want to make your will for?" Rose asked. "You're
strong enough, aren't you?"
"It is the duty of every one with a great deal of money to make their
will directly they are twenty-one," the boy declared, as though
repeating a lesson. "If I had my own way," he added, looking up at
Rose, "I should leave a great deal of money to you, but I don't
suppose I shall be allowed to."
"Good gracious, Mr. Dompers!" Rose exclaimed. "Why, I scarcely
know you!"
"I like your face," the young man continued earnestly. "If you saw
the faces of the people who are staying at the Grange, you would
know what I mean. They all look as though they wanted something.
They remind me sometimes of a pack of hounds. And they pretend
not to, but they are always watching me."
We had been so engrossed in the self-disclosures of this half-witted
young man that we had not noticed the approach of another
promenader along the sands. It was a very different person who
now accosted us, hat in hand and a courteous smile upon his lips.
There was not a single criticism in which the most fastidious might
indulge against Hilary Duncombe's address, his manners or his
clothes.
"Good morning! I am glad to see that my young ward has been
finding friends."
The young man scrambled at once to his feet and stood, awkward
and speechless, a little apart. His tutor, the very prototype of kindly
and aristocratic ease, addressed a few kindly remarks to us.
"I am so thankful," he went on, "when Arthur finds courage to speak
to any one. He is a good boy, but he finds conversation with
strangers as a rule difficult."
"We haven't found him at all shy," Rose assured him, with a smile at
the subject of these remarks. "On the contrary, he has been
entertaining us quite nicely."
Mr. Duncombe appeared to find Rose's favourable judgment a matter
for personal gratification.
"You are very kind," he said. "I am sure that Arthur has already told
you how charmed we were with your performance last night. My
guests are agitating for a permanent change in our dinner hour, that
we may be more frequent attendants."
"How nice!" Rose murmured. "It does make quite a difference to see
some civilised people in the reserved seats."
"My sister," Duncombe continued, "would be delighted to make your
acquaintance. We may, perhaps, persuade you to pay us a little visit
at the Grange after the performance one evening. Arthur," he went
on, "we must get back now. Ella is waiting for a set of tennis."
They moved off together. The impression they left behind was an
unpleasant one.
"A second Ardalmont case," Leonard suggested.
"In which case," I reflected gloomily, "the mystery of our presence
here is solved."
We were a little depressed as we returned to the hotel—a long,
grey-stone building, once a farmhouse and still entirely
unpretentious. Our worst prognostications were promptly verified.
The maidservant who waited upon us in the coffee room brought me
a note with a typewritten address.
"This was left here by a motor-cyclist soon after you went out, sir,"
she announced.
I tore open the envelope and we pored over it:

Accept any hospitality proffered from the Grange. Encourage the


young man, Arthur Dompers, to talk, watch Duncombe, and
report on the situation.

"Dull as ditchwater!" I exclaimed, as I tore up the communication in


disgust. "An unprepossessing cub of a boy, whom his tutor permits
to be fleeced at billiards and whom he is probably going to marry to
his sister. Sordid as it can be. Not a thrill in it for us."
"This may be my show," Rose mused, her blue eyes very wide open
and innocent. "I may be able to guide the young man from the
matrimonial noose. I wonder if he is really very rich. Perhaps I'll
marry him myself. I suppose I could keep him on a chain."
I sipped my apéritif gloomily. The taste of true adventures was still
upon my palate, and the obviousness of this one repelled.
Our ideas as to the menacing nature of Arthur Dompers'
surroundings were to some extent modified by our first visit to the
Grange, which took place that night after the performance. Ella
Duncombe was a rather slangy, somewhat unpleasant-looking young
woman of apparently twenty-six or twenty-seven years of age. She
had a bad temper, which she scarcely troubled to conceal, and
conducted herself generally towards her brother's charge with more
contempt than toleration. She scarcely fulfilled one's idea of an
adventuress. Major Lethwaite, a guest in the house whom we had
fixed upon as the person accustomed to play Arthur Dompers for a
hundred pounds at billiards whenever finances ran low, was to all
appearance a perfectly harmless person who played sixpenny points
at bridge and thought sixpenny pool excessive. Laura Richardson, a
friend of Ella's, was just an ordinary, fairly well-bred, good-looking
but rather boisterous young person. Mrs. Scatterwell, whose place
apparently was that of chaperon, was a handsome and rather silent
woman, whose sole interest seemed to be centred in Duncombe
himself. The ménage was perhaps a curious one, but scarcely
suspicious. Our host himself appeared to have no reserves except on
the subject of his young charge.
"After the war was a bit of a knock for most of us," he remarked
meditatively, as we men sat in the smoking room of the Grange after
a very excellent supper. "Here are you, Lister, with a game arm,
going round the country entertaining, more or less, I take it, for your
living. I tried every job that was offered me and did very little good
at any of them. Last of all I took this bear-leading on, and, between
you and me, I sometimes wish to God I hadn't!"
"Why?" I asked. "The boy seems amiable enough."
"He seems so," Duncombe assented drily, "but the fact of it is that
he is innately clumsy and innately deceitful. There is no sport for
which he shows the least aptitude. I've tried them all with the same
result. The only thing he can do is swim, and even then it's hard
work to get him into the sea unless the sun shines. He hasn't the
slightest taste; I am bound by the trustees' deed to allow him pocket
money at the rate of a hundred pounds a month, and half of it he
spends in buying most outrageous clothes. You know who he is, I
suppose?"
"Not an idea," I replied.
Duncombe's eyebrows were slightly raised. He looked at me keenly.
"Dear me!" he exclaimed. "I took it for granted that you knew the
story. He is the Welsh miner's orphan, who inherited two and a
quarter million from Jacob Dompers of New York. A nice little
windfall for a cub like this, isn't it?"
I remembered reading the story in the newspapers some years ago.
So did Leonard.
"What about his relatives?" the latter asked.
"The only one with whom I have had any communication,"
Duncombe replied, "was a Welsh Baptist Minister who declined to
have anything to say to the young man, and who wrote me on half a
sheet of brown grocery paper, pointing out by means of many
Biblical texts that no person with a banking account could hope to
escape the flames of the bottomless pit."
"Who placed the boy in your charge, then?" I enquired.
"The London agents for the New York solicitors. I answered an
advertisement. I think they realise," he went on, "that I have done
my best. I have tried to fit him for one or two professions, in vain."
"How long have you had him?" Leonard asked.
Duncombe's long fingers played for a moment with his small black
moustache. There was a quick light in his eyes as he glanced
towards Leonard.
"Three years this June," he answered.
"Then he was sixteen when he came to you?"
Duncombe assented with a little motion of his head.
"You probably think that he is backward now for nineteen," he said.
"You should have seen him when he came to me."
"I suppose he is backward," I admitted, "and yet, to tell you the
truth, I should have thought him older."
"His twentieth birthday is this week," Duncombe told us. "I am
getting a thousand a year and my expenses for looking after him,
and I haven't any prospects of a job when he is out of my hands,
but I wish to heavens it was his twenty-first!—I suppose we ought to
see what the others are doing."
We made our way out into the hall, which was the main living room
of the Grange. Arthur was playing billiards with Lethwaite, playing
sullenly and without interest, and turning around after every stroke
to listen to the conversation between Rose and the other two girls,
who were seated upon a lounge, watching. Lethwaite, just as we
appeared, went out with a stroke which was an obvious fluke. Arthur
flung half a crown across the table and put up his cue ill-humoredly.
"Beastly fluke!" he grumbled. "No one can play against such luck."
He strode over with his hands in his pockets to where Rose was
seated. Miss Duncombe watched him approach with a sombre light
in her dark eyes.
"Bad-tempered again, Arthur?" she observed.
"He's a rotten fluker," the young man rejoined surlily. "He wins all my
pocket money."
For a single moment the whole situation seemed to be
commonplace, almost absurd. Here was a sulky, ill-conditioned boy,
pitchforked into the charge of a very ordinary little company of
gentlepeople, who were doing their best to make him one of
themselves. Duncombe's rebuke was free from all severity, and it
was certainly merited.
"Arthur," he said, "you should never accuse your opponent of fluking
at any game. Take your defeat in silence if you cannot be pleasant
about it. Mr. Lister or Mr. Cotton would tell you that I am giving you
good advice."
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookmass.com

You might also like