Coding Clean, Reliable, and Safe REST APIs with ASP.NET Core 8 1st Edition Anthony Giretti pdf download
Coding Clean, Reliable, and Safe REST APIs with ASP.NET Core 8 1st Edition Anthony Giretti pdf download
https://ebookmass.com/product/coding-clean-reliable-and-
safe-rest-apis-with-asp-net-core-8-1st-edition-anthony-
giretti/
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/
https://ebookmass.com/product/geometric-patterns-with-creative-coding-
coding-for-the-arts-1st-edition-selcuk-artut/
https://ebookmass.com/product/geometric-patterns-with-creative-
coding-1st-edition-selcuk-artut/
https://ebookmass.com/product/pro-asp-net-core-3-develop-cloud-ready-
web-applications-using-mvc-blazor-and-razor-pages/
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
Acknowledgments�����������������������������������������������������������������������������xiii
Prerequisites��������������������������������������������������������������������������������������xv
Introduction��������������������������������������������������������������������������������������xvii
iii
Table of Contents
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
v
Table of Contents
vi
Table of Contents
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
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
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)
2
Chapter 1 Introducing HTTP and REST
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.
4
Chapter 1 Introducing HTTP and REST
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:
6
Chapter 1 Introducing HTTP and REST
7
Chapter 1 Introducing HTTP and REST
RFC 7231 does not describe all the existing verbs, and there are others!
RFC 5789 defines the PATCH verb. This RFC can be found here: www.rfc-
editor.org/rfc/rfc5789.html.
The PATCH verb can be confused with PUT and POST verbs because
they all allow modifying a resource on a server. PATCH partially updates a
resource (like POST) when PUT tends to replace a resource.
I see many developers confusing each other. Now you are aware of
what the RFCs indicate about these verbs, but see that it is commonly
accepted to use POST for resource creation or to replace GET verb when
there are too many parameters in the URI to put them in the body of a
POST. It’s also commonly accepted to use PUT to entirely or partially
replace a resource even if PATCH is made for that. Personally, I rarely
use PATCH, only when I want to update a single property of a resource
(e.g., a date). From the moment I start modifying and altering several
properties of a resource (a date, a status, a description, etc.), I instead
implement PUT.
If you recall, I briefly mentioned HTTP status codes in this section. The
following section will discuss how status codes link to HTTP verbs. Some
verbs are used essentially with certain HTTP statuses. In the next section,
I will list the HTTP statuses and what verbs they can be associated with.
8
Chapter 1 Introducing HTTP and REST
detail each HTTP status class and each HTTP code because RFC 7231
does a pretty good job of doing so, and I won’t use all of them in this book.
Regarding APIs, status codes are essential for clients to understand what
the server is trying to tell us. They provide us with insights on what to
do next.
An HTTP status code has three digits. The first digit defines the status
category, and there are five categories of HTTP status codes:
• 5xx: They tell the client that the request on the server
has not been completed due to an error.
RFC 7231 is not the only RFC that describes HTTP status codes.
However, it describes the codes most often used. RFC 4918 and RFC 6585
complete the list, with other codes covering other scenarios.
Table 1-1, taken from the following RFCs
9
Chapter 1 Introducing HTTP and REST
lists the association between HTTP status codes and HTTP verbs
commonly used as industry standards. I won’t use all of them in this book;
you will not need to know them by heart. On the other hand, knowing their
existence is valuable since you will know their existence and how to use
them when required. Later in this book, I’ll dig deeper into why I’m using
some of them in the code samples I provide.
Table 1-1. List of available HTTP status codes and verbs most often
used with them
Code Reason phrase RFC Associated verb
10
Chapter 1 Introducing HTTP and REST
11
Chapter 1 Introducing HTTP and REST
This may seem like a lot of HTTP status codes, but remember that in
99% of the cases, you will only use a handful of codes described here.
Later in this book, we will come back together to some of them, and I
will explain them to you with examples of their usefulness.
Now let’s move on to another essential component of an HTTP request
and response, the request and response headers.
12
Chapter 1 Introducing HTTP and REST
RFCs describe them in detail. Remember that this book will not cover
all possible use cases; specific headers are generated automatically by a
browser during the request, some during the response, and by the server.
You will not need to know them by heart. On the other hand, knowing they
exist is excellent as you get to know they exist and you can customize them
for your needs when necessary.
Note Although RFC 7231 describes (or redirects to other RFCs) the
best-known headers, in reality, there is a complete list of headers
(even the most unknown, but without many details) for which you can
consult RFC 4229 here: https://datatracker.ietf.org/doc/
html/rfc4229.
Request Headers
Like HTTP status codes, request headers are divided into classes, five
exactly:
• Controls headers
• Conditional headers
In the following subsections, I will tell you in what RFCs these headers
are described, and I will list the links of these RFCs at the end of this
section.
13
Chapter 1 Introducing HTTP and REST
Controls Headers
There are seven headers in the Controls class. Some of them have various
possible directives (key/value pair):
14
Chapter 1 Introducing HTTP and REST
Conditional Headers
15
Chapter 1 Introducing HTTP and REST
16
Chapter 1 Introducing HTTP and REST
17
Chapter 1 Introducing HTTP and REST
These request headers are the most common headers you see. Don’t
worry about remembering them. This is why RFCs (and my book) exist.
Since RFCs define standards, you will come to know how to use them
when and where over time. Let’s now move to response headers.
Note Although RFCs describe the usage of many headers, you are
free to use your custom headers. You can create a specific request
header for your application and add value to it.
As promised, here is Table 1-2 that references the links for each RFC I
mentioned earlier in this section.
18
Chapter 1 Introducing HTTP and REST
7230 www.rfc-editor.org/rfc/rfc7230
7231 www.rfc-editor.org/rfc/rfc7231
7232 www.rfc-editor.org/rfc/rfc7232
7233 www.rfc-editor.org/rfc/rfc7233
7234 www.rfc-editor.org/rfc/rfc7234
7235 www.rfc-editor.org/rfc/rfc7235
Response Headers
We just went over a series of headers used in an HTTP request. If it is
essential to send metadata to the server, it is not less for the response
headers. They are essential for informing the client (a browser or an
application) of additional metadata relating to the context of the HTTP
response. Some are defined in RFC 7231 and others in RFCs 7232, 7233,
7234, and 7235, already introduced in the previous section.
There are four response header classes. Here they are:
19
Chapter 1 Introducing HTTP and REST
These headers are among the most important. These headers make it
possible to enrich the information sent to the client. They are usually
paired with an appropriate HTTP status code. Here is the list of these eight
headers:
20
Chapter 1 Introducing HTTP and REST
21
Chapter 1 Introducing HTTP and REST
The server (or a proxy) allows the client to be told which authentication the
server (proxy) accepts, and there are two:
Like the client, the server can send additional contextual data related to
the requested resource. There are three:
22
Chapter 1 Introducing HTTP and REST
Note Like the request headers, you can use your custom response
headers. You can create a specific response header for your
application and add any value to it.
23
Chapter 1 Introducing HTTP and REST
Figure 1-2 illustrates what a URI looks like with its parts.
24
Chapter 1 Introducing HTTP and REST
I’ll stop with the URI examples because we’ll return to it in this
chapter’s “Extend Your Talent on the Web with REST Architecture Style”
section.
Once again, if you want to learn what a URI is in depth, I suggest you
read RFC 3986.
URL
You’ve probably heard of the Uniform Resource Locator (URL) before. Well,
I bet you could have confused URI and URL like me. I will demystify this
for you.
25
Chapter 1 Introducing HTTP and REST
To learn more about them, I suggest you read RFC 1738, which can be
found here: www.rfc-editor.org/rfc/rfc1738.
I will discuss URLs again in the “Extend Your Talent on the Web with
REST Architecture Style” section as I will for URIs.
And Others…
Two other acronyms can be associated/confused with URI and URL, and
these are the following:
26
Chapter 1 Introducing HTTP and REST
These last two do not represent any interest, at least in this book, but
as you certainly have an unquenchable thirst for learning, I offer you the
resources to cultivate yourself further.
Parameters
Parameters… And, yes, without telling you, we have already discussed
them since this chapter began. What are they for? Well, they are used to
find a specific resource (not always) on the server. How? First, we can use
them differently, and here they are (again). I’m sure this will remind you of
something:
These last two ways of proceeding are the most adequate, and we will
see why in the “Extend Your Talent on the Web with REST Architecture
Style” section. Yes, I’ve been teasing you for a while in this section, but
we’ll get there soon!
27
Chapter 1 Introducing HTTP and REST
Error Handling
Because HTTP has been well designed, it has been described as an
elegant way of handling errors, because, in absolute terms, incorporating
errors properly into an HTTP response is simply vital. There’s an RFC that
describes this, RFC 7807, which you can find here: https://datatracker.
ietf.org/doc/html/rfc7807.
This RFC defines a JSON contract, named Problem Details, returned in
response to an API client when an error occurs. Problem Details contains
the elements described in Table 1-3, taken as is, from RFC 7807.
28
Chapter 1 Introducing HTTP and REST
29
Chapter 1 Introducing HTTP and REST
So how does SSL/TLS work? A key exchange occurs between the client
and the server. The latter will establish an encrypted connection named
TLS handshake.
You don’t need to know how the TLS handshake works, but if you
are interested, you can learn more about it here: www.cloudflare.com/
learning/ssl/what-happens-in-a-tls-handshake/.
Only the client and the server possessing the decryption key can
encrypt/decrypt the data exchanged. To make it possible, the server
needs to obtain an SSL certificate, which the server’s administrator (or
a developer) will install and has previously been obtained by them from
a Certificate Authority (CA). I won’t go into detail here. This book will
deal with the implementation of APIs with ASP.NET Core. The latter will
automatically (but with your consent) use an SSL certificate when first run
in Visual Studio 2022. However, I will show you how to force your APIs to
use HTTPS when a client invokes a URL by configuring the HTTP Strict
Transport Security (HSTS) policy mechanism in ASP.NET Core. To learn
more in depth about HTTPS, TLS, and HSTS, they are described in the
following RFCs:
30
Chapter 1 Introducing HTTP and REST
I advise you to read these RFCs only if you feel the need to understand
every aspect of HTTPS, but in everyday life, what you will have to
remember is the need to install an SSL certificate on the server, which will
allow the exchange of an encryption/decryption key on the server and the
client where the data will no longer be readable in plain text or modifiable
on the Internet. Figure 1-4, therefore, summarizes the situation.
31
Chapter 1 Introducing HTTP and REST
only the application/json format and the en-CA language; accepting gzip,
deflate, and br (Brotli) encoding; and finally authenticating with the basic
authentication. The response returns status 200 OK with the requested
Content-Type application/json, the Content-Length response, the server
technology (Kestrel), and a JSON payload. I voluntarily let the request and
response data clear even if HTTPS appears in Figure 1-5.
32
Other documents randomly have
different content
The Project Gutenberg eBook of The 3rd Party
This ebook is for the use of anyone anywhere in the United States
and most other parts of the world at no cost and with almost no
restrictions whatsoever. You may copy it, give it away or re-use it
under the terms of the Project Gutenberg License included with this
ebook or online at www.gutenberg.org. If you are not located in the
United States, you will have to check the laws of the country where
you are located before using this eBook.
Language: English
The laboratories at Arctic City were fairly new but already had the
cluttered appearance of all research labs. Electronic instruments,
coils of wire, and various articles of chemical apparatus lay on the
work benches. One room held the dial-studded face of a computer.
Another contained several induction and carbon arc furnaces used in
high temperature work. Men wearing white smocks or plastic aprons
went quietly and efficiently about their tasks.
Roger and Darcy entered a lab in which a man sat staring at the face
of an oscilloscope, where weird figures danced in yellowish-green
tracery. The bench was covered with a bewildering array of
equipment. A row of gas discharge tubes glowed with varicolored
light. From them a spaghetti-like arrangement of many colored wires
led to various instruments scattered along the bench.
"How's it coming, Phil?" Darcy asked.
The man looked up from his work. "Hi, Jake," he said. "I might get
somewhere if this oscillator would stop wandering all over the place.
This thing doesn't seem to be very accurate at high frequencies." He
indicated a piece of equipment connected to the oscilloscope.
"I'll sure be glad when we get a good physical chemist to do this
work. My business is ceramics, and I'm getting sick and tired of
wrestling with his wiring."
"Well," said Darcy, "you won't have to worry about this any more.
This is Roger Lorin, our new physical chemist. Roger, this is Philip
Gordon, our ceramics expert."
Gordon grinned and extended his hand. "I'm glad to meet you," he
said. "Sorry I blew off like that. I just get disgusted sometimes."
"It does get frustrating," Roger agreed as they shook hands.
"Electronics is rather tricky."
"You're right there," replied Gordon. "Especially when you don't
know too much about it. What I learned about electronics in college
has long since departed. Take a look at this set up. It's about as
poor a job of haywiring as you'll find anywhere."
"I see you're using high frequency excitation to get your high
temperatures," Roger commented. "Just what compounds are you
working with?"
"I've been working with some plastics, inert stuff, to see just what
they'll react with, and how fast they'll react at high temperatures."
"It isn't too easy," Lorin said. "It never has been easy to find
reaction rates. I'll get to work on these this afternoon. Maybe I can
get some of these finished tomorrow or the next day."
"Thanks," Gordon said in a relieved voice. "It'll be good to get some
results I can rely on."
Lorin and Darcy left the lab and walked through a winding
succession of corridors until they came to a large room. One wall
was lined with catwalks linked by metal ladders. Men in coveralls
moved against the slate gray background like insects on the side of
a building. Through a door to their right Lorin could see banks of
instruments at which several men were working.
"This is the south face of the pile," Darcy said. "Most of the
instruments are located here. The Klysten converters are mounted in
that room over there." He indicated a door on their left.
"I'd like to see those," Roger said. "I hear that these are pretty large
compared with what we had at the moon labs."
"They're big enough all right," Darcy said. "Each one is four stories
high. We had a deuce of a time evacuating them."
As Darcy said this, they stepped into a long high room. To their right
stood six immense transparent tubes. Each tube contained a grid of
thick steel bars which was mounted so that it completely surrounded
a coil of heavy copper bar in the center of the tube. The steel bars
had been treated so that a magnetic field would build up rapidly
when they were exposed to hard radiations. The radiation beams
were passed into the grid in pulses, thus causing the magnetic field
to build up and collapse rapidly producing current in the coils by
induction. The tubes were generators with no moving parts except
electrons and protons. The system used about seventy-five per cent
of the energy produced by the pile. The residual radiation was
released as greenish yellow light.
"Why are they transparent?" Roger asked. "I should think that
metals would be stronger and easier to manage."
"The transparency helps us to maintain a more accurate control,"
Darcy replied. "When the light shifts toward the blue, we know that
more energy is being released as radiation, and can shut down the
tube before it gets a chance to heat up too much."
"Good idea," said Roger. "Control was our worst trouble at the moon
labs."
"We'll use this until we find something better," said Darcy as they left
the pile area.
Five hundred miles above the Earth, the polar weather station
wheeled silently through space. A sphere two hundred feet in
diameter, it was girded by a ring deck that was home to forty men
and women. The big observation room was the real reason for the
space station's existence. Here, the weathermen kept watch over the
movements of Earth's atmosphere. The fluffy white clouds that
appeared on their screens told a tale of mass air movements that
meant stormy or clear weather for the Earth below. An almost
blinding white mass of cloud over Canada told of a cold front moving
southward to collide with warm air from the Gulf of Mexico and
unleash a blizzard over the plains of the Midwest. Tumbling clouds
hid a storm that whipped the North Atlantic into a raging fury of
white water. Clear areas showed where snow sparked under the
winter sun or where soft tropical breezes ruffled the fronds of palm
trees.
The station was passing over the Pampas of Argentina on the day
side of Earth when the incident occurred. Miriam Andrews, on duty
at the time, sat watching the progress of a small rain squall.
Suddenly a look of surprise crossed her rather plain features, and
she turned the amplifier gain-knob of the light amplifying telescope
to higher magnification. On the screen appeared a sprawling airport
on which lay scores of large, box-like transport planes. Into the
huge, channel winged craft flowed lines of robot controlled armored
vehicles. Miriam, who had a keen mind and an interest in
international affairs, recognized the dangerous possibilities of these
preparations. She did not hesitate to call the station director. That
individual was summoned from a deep sleep by the imperative
buzzing of the intercom. He switched the instrument on, saw
Miriam's excited face, and came fully awake with a feeling of alarm.
Excitement on the part of station personnel was apt to mean deadly
danger. He interrupted the excited girl. "Repeat that again and slow
down." Miriam repeated her story.
"I'll send a message when we get close enough to Chicago to use a
tight beam," he said. "There's no use spreading that news all over
the western hemisphere." With that he broke the connection and
called the radio room to give instructions about the message.
The station swept around the Earth untroubled by the gathering fury
below. A rocket, a slender, blue steel, winged cone, blasted away
from the station with a brief but brilliant display of its atomic jets.
The watches changed, and the weathermen continued to receive
data, analyze it, and send it to the coordinating centers on Earth.
Although most of the men on the station heard the news with the
detachment of those whose main interest lies in space and on the
moon, the North American government was not so calm. It was not
long before big formations of box-like transports were headed
southward with heavy loads of flying armored equipment,
technicians, and troops. Flights of dart like interceptors patrolled the
gulf area, ranging the blue skies at supersonic speeds. On the
ground, rows of slim antiaircraft missiles stood like candles in a
birthday cake. At the first flicker on a radar screen, they would
scream skyward to intercept hydrogen and atom armed missiles at
the borderline of space. Both powers made good resolutions of
nonaggression, but the rest of the world watched the preparations
with a skeptical eye. The weapons that could unleash the horrors of
nuclear warfare at the flick of a switch stood in frightening array on
both sides of the gulf.
Meanwhile, the police prepared to close in on the mountain cabin.
Equipped with gas bombs, machine pistols and recoiless rifles, they
came struggling through a snow clogged pass and down the
mountain sides from hovering planes. Unseen in the darkness, they
crept through the woods toward the house. A rifle shot cracked as a
guard sighted them with his sniperscope. One of the policemen fell,
a bullet in his leg. The lights in the house went out, and gun flashes
lanced through the windows. Bullets, hunting their prey like angry
wasps, snarled through the darkness.
Roger was locked in an upstairs bedroom with a guard before the
door. During the next two hours, the roar of machine pistols and the
crack of rifle fire split the mountain stillness and echoed from the
hillsides. At the end of that time, the police withdrew to rearrange
their strategy.
Juarez sat on the floor near a broken window and cleaned his
machine pistol. "I think that it is time to kill Lorin and get out of
here," he said, as he placed a fresh clip in the magazine. "It will
serve us to good advantage."
"Fool!" Gomez exclaimed. "If they found us with a dead man on our
hands, we wouldn't stand a chance. I have used this place enough
to know that they have us pinned in. We can use Lorin as a
bargaining point. We will arrange to take him with us and drop him
by parachute. But—the parachute will not open. A convertiplane,
which I have called, will meet us above the clouds and take us away
before they can stop us."
"They will not trust our word," Juarez said. "We cannot get away
with it."
"Oh, but we can," Gomez said. "The police know that Lorin's death
would have regrettable results. Even the fact that he is a citizen of
the North American Union would be enough to start trouble, let
alone his position as a key research man on the neutron project.
They will do anything to see that he remains alive. The scheme will
further enrage the North Americans and might perhaps incite them
to war."
"I see," replied Juarez. "An excellent plan. Let's contact the police,
and see what happens."
ebookmasss.com