SlideShare a Scribd company logo
Visit https://ebookultra.com to download the full version and
explore more ebooks
HTTP The Definitive Guide 1st Edition David
Gourley
_____ Click the link below to download _____
https://ebookultra.com/download/http-the-definitive-
guide-1st-edition-david-gourley/
Explore and download more ebooks at ebookultra.com
Here are some suggested products you might be interested in.
Click the link to download
JavaScript The Definitive Guide 5th Edition David Flanagan
https://ebookultra.com/download/javascript-the-definitive-guide-5th-
edition-david-flanagan/
JavaScript The Definitive Guide 6th Edition David Flanagan
https://ebookultra.com/download/javascript-the-definitive-guide-6th-
edition-david-flanagan/
Animal The Definitive Visual Guide 3rd Edition David
Burnie
https://ebookultra.com/download/animal-the-definitive-visual-
guide-3rd-edition-david-burnie/
AppleScript The Definitive Guide 2nd Edition The
Definitive Guide
https://ebookultra.com/download/applescript-the-definitive-guide-2nd-
edition-the-definitive-guide/
DK Smithsonian Animal The Definitive Visual Guide Third
Edition David Burnie
https://ebookultra.com/download/dk-smithsonian-animal-the-definitive-
visual-guide-third-edition-david-burnie/
NetBeans The Definitive Guide 1st Edition Tim Boudreau
https://ebookultra.com/download/netbeans-the-definitive-guide-1st-
edition-tim-boudreau/
MongoDB The Definitive Guide 1st Edition Kristina Chodorow
https://ebookultra.com/download/mongodb-the-definitive-guide-1st-
edition-kristina-chodorow/
Mercurial The Definitive Guide 1st Edition Bryan
O'Sullivan
https://ebookultra.com/download/mercurial-the-definitive-guide-1st-
edition-bryan-osullivan/
Maven The Definitive Guide 1st Edition Sonatype Company
https://ebookultra.com/download/maven-the-definitive-guide-1st-
edition-sonatype-company/
HTTP The Definitive Guide 1st Edition David Gourley
HTTP The Definitive Guide 1st Edition David Gourley
Digital Instant Download
Author(s): David Gourley, Brian Totty
ISBN(s): 9781565925090, 1565925092
Edition: 1
File Details: PDF, 9.52 MB
Year: 2002
Language: english
HTTP The Definitive Guide 1st Edition David Gourley
HTTP The Definitive Guide 1st Edition David Gourley
HTTP
The Definitive Guide
HTTP The Definitive Guide 1st Edition David Gourley
HTTP
The Definitive Guide
David Gourley and Brian Totty
with Marjorie Sayer, Sailu Reddy, and Anshu Aggarwal
Beijing • Cambridge • Farnham • Köln • Paris • Sebastopol • Taipei • Tokyo
HTTP: The Definitive Guide
by David Gourley and Brian Totty
with Marjorie Sayer, Sailu Reddy, and Anshu Aggarwal
Copyright © 2002 O’Reilly Media, Inc. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol,
CA 95472.
O’Reilly Media, Inc. books may be purchased for educational, business, or sales promotional use. On-
line editions are also available for most titles (safari.oreilly.com). For more information, contact our cor-
porate/institutional sales department: (800) 998-9938 or corporate@oreilly.com.
Editor: Linda Mui
Production Editor: Rachel Wheeler
Cover Designer: Ellie Volckhausen
Interior Designers: David Futato and Melanie Wang
Printing History:
September 2002: First Edition.
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of
O’Reilly Media, Inc. HTTP: The Definitive Guide, the image of a thirteen-lined ground squirrel, and
related trade dress are trademarks of O’Reilly Media, Inc. Many of the designations used by
manufacturers and sellers to distinguish their products are claimed as trademarks. Where those
designations appear in this book, and O’Reilly Media, Inc. was aware of a trademark claim, the
designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and authors
assume no responsibility for errors or omissions, or for damages resulting from the use of the
information contained herein.
This book uses RepKover™
, a durable and flexible lay-flat binding.
ISBN-10: 1-56592-509-2
ISBN-13: 978-1-56592-509-0
[C] [01/08]
v
Table of Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Part I. HTTP: The Web’s Foundation
1. Overview of HTTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
HTTP: The Internet’s Multimedia Courier 3
Web Clients and Servers 4
Resources 4
Transactions 8
Messages 10
Connections 11
Protocol Versions 16
Architectural Components of the Web 17
The End of the Beginning 21
For More Information 21
2. URLs and Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Navigating the Internet’s Resources 24
URL Syntax 26
URL Shortcuts 30
Shady Characters 35
A Sea of Schemes 38
The Future 40
For More Information 41
3. HTTP Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
The Flow of Messages 43
The Parts of a Message 44
vi | Table of Contents
Methods 53
Status Codes 59
Headers 67
For More Information 73
4. Connection Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
TCP Connections 74
TCP Performance Considerations 80
HTTP Connection Handling 86
Parallel Connections 88
Persistent Connections 90
Pipelined Connections 99
The Mysteries of Connection Close 101
For More Information 104
Part II. HTTP Architecture
5. Web Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Web Servers Come in All Shapes and Sizes 109
A Minimal Perl Web Server 111
What Real Web Servers Do 113
Step 1: Accepting Client Connections 115
Step 2: Receiving Request Messages 116
Step 3: Processing Requests 120
Step 4: Mapping and Accessing Resources 120
Step 5: Building Responses 125
Step 6: Sending Responses 127
Step 7: Logging 127
For More Information 127
6. Proxies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Web Intermediaries 129
Why Use Proxies? 131
Where Do Proxies Go? 137
Client Proxy Settings 141
Tricky Things About Proxy Requests 144
Tracing Messages 150
Proxy Authentication 156
Table of Contents | vii
Proxy Interoperation 157
For More Information 160
7. Caching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Redundant Data Transfers 161
Bandwidth Bottlenecks 161
Flash Crowds 163
Distance Delays 163
Hits and Misses 164
Cache Topologies 168
Cache Processing Steps 171
Keeping Copies Fresh 175
Controlling Cachability 182
Setting Cache Controls 186
Detailed Algorithms 187
Caches and Advertising 194
For More Information 196
8. Integration Points: Gateways, Tunnels, and Relays . . . . . . . . . . . . . . . . . . . . 197
Gateways 197
Protocol Gateways 200
Resource Gateways 203
Application Interfaces and Web Services 205
Tunnels 206
Relays 212
For More Information 213
9. Web Robots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Crawlers and Crawling 215
Robotic HTTP 225
Misbehaving Robots 228
Excluding Robots 229
Robot Etiquette 239
Search Engines 242
For More Information 246
10. HTTP-NG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
HTTP’s Growing Pains 247
HTTP-NG Activity 248
viii | Table of Contents
Modularize and Enhance 248
Distributed Objects 249
Layer 1: Messaging 250
Layer 2: Remote Invocation 250
Layer 3: Web Application 251
WebMUX 251
Binary Wire Protocol 252
Current Status 252
For More Information 253
Part III. Identification, Authorization, and Security
11. Client Identification and Cookies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
The Personal Touch 257
HTTP Headers 258
Client IP Address 259
User Login 260
Fat URLs 262
Cookies 263
For More Information 276
12. Basic Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Authentication 277
Basic Authentication 281
The Security Flaws of Basic Authentication 283
For More Information 285
13. Digest Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
The Improvements of Digest Authentication 286
Digest Calculations 291
Quality of Protection Enhancements 299
Practical Considerations 300
Security Considerations 303
For More Information 306
14. Secure HTTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
Making HTTP Safe 307
Digital Cryptography 309
Table of Contents | ix
Symmetric-Key Cryptography 313
Public-Key Cryptography 315
Digital Signatures 317
Digital Certificates 319
HTTPS: The Details 322
A Real HTTPS Client 328
Tunneling Secure Traffic Through Proxies 335
For More Information 336
Part IV. Entities, Encodings, and Internationalization
15. Entities and Encodings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
Messages Are Crates, Entities Are Cargo 342
Content-Length: The Entity’s Size 344
Entity Digests 347
Media Type and Charset 348
Content Encoding 351
Transfer Encoding and Chunked Encoding 354
Time-Varying Instances 359
Validators and Freshness 360
Range Requests 363
Delta Encoding 365
For More Information 369
16. Internationalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
HTTP Support for International Content 370
Character Sets and HTTP 371
Multilingual Character Encoding Primer 376
Language Tags and HTTP 384
Internationalized URIs 389
Other Considerations 392
For More Information 392
17. Content Negotiation and Transcoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
Content-Negotiation Techniques 395
Client-Driven Negotiation 396
Server-Driven Negotiation 397
Transparent Negotiation 400
x | Table of Contents
Transcoding 403
Next Steps 405
For More Information 406
Part V. Content Publishing and Distribution
18. Web Hosting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
Hosting Services 411
Virtual Hosting 413
Making Web Sites Reliable 419
Making Web Sites Fast 422
For More Information 423
19. Publishing Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
FrontPage Server Extensions for Publishing Support 424
WebDAV and Collaborative Authoring 429
For More Information 446
20. Redirection and Load Balancing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
Why Redirect? 449
Where to Redirect 449
Overview of Redirection Protocols 450
General Redirection Methods 452
Proxy Redirection Methods 462
Cache Redirection Methods 469
Internet Cache Protocol 473
Cache Array Routing Protocol 475
Hyper Text Caching Protocol 478
For More Information 481
21. Logging and Usage Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
What to Log? 483
Log Formats 484
Hit Metering 492
A Word on Privacy 495
For More Information 495
Table of Contents | xi
Part VI. Appendixes
A. URI Schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
B. HTTP Status Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
C. HTTP Header Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
D. MIME Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533
E. Base-64 Encoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570
F. Digest Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574
G. Language Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
H. MIME Charset Registry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
HTTP The Definitive Guide 1st Edition David Gourley
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
xiii
Preface
The Hypertext Transfer Protocol (HTTP) is the protocol programs use to communi-
cate over the World Wide Web. There are many applications of HTTP, but HTTP is
most famous for two-way conversation between web browsers and web servers.
HTTP began as a simple protocol, so you might think there really isn’t that much to
say about it. And yet here you stand, with a two-pound book in your hands. If you’re
wondering how we could have written 650 pages on HTTP, take a look at the Table
of Contents. This book isn’t just an HTTP header reference manual; it’s a veritable
bible of web architecture.
In this book, we try to tease apart HTTP’s interrelated and often misunderstood
rules, and we offer you a series of topic-based chapters that explain all the aspects of
HTTP. Throughout the book, we are careful to explain the “why” of HTTP, not just
the “how.” And to save you time chasing references, we explain many of the critical
non-HTTP technologies that are required to make HTTP applications work. You can
find the alphabetical header reference (which forms the basis of most conventional
HTTP texts) in a conveniently organized appendix. We hope this conceptual design
makes it easy for you to work with HTTP.
This book is written for anyone who wants to understand HTTP and the underlying
architecture of the Web. Software and hardware engineers can use this book as a
coherent reference for HTTP and related web technologies. Systems architects and
network administrators can use this book to better understand how to design,
deploy, and manage complicated web architectures. Performance engineers and ana-
lysts can benefit from the sections on caching and performance optimization. Mar-
keting and consulting professionals will be able to use the conceptual orientation to
better understand the landscape of web technologies.
This book illustrates common misconceptions, advises on “tricks of the trade,” pro-
vides convenient reference material, and serves as a readable introduction to dry and
confusing standards specifications. In a single book, we detail the essential and inter-
related technologies that make the Web work.
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
xiv | Preface
This book is the result of a tremendous amount of work by many people who share
an enthusiasm for Internet technologies. We hope you find it useful.
Running Example: Joe’s Hardware Store
Many of our chapters include a running example of a hypothetical online hardware
and home-improvement store called “Joe’s Hardware” to demonstrate technology
concepts. We have set up a real web site for the store (http://www.joes-hardware.
com) for you to test some of the examples in the book. We will maintain this web site
while this book remains in print.
Chapter-by-Chapter Guide
This book contains 21 chapters, divided into 5 logical parts (each with a technology
theme), and 8 useful appendixes containing reference data and surveys of related
technologies:
Part I, HTTP: The Web’s Foundation
Part II, HTTP Architecture
Part III, Identification, Authorization, and Security
Part IV, Entities, Encodings, and Internationalization
Part V, Content Publishing and Distribution
Part VI, Appendixes
Part I, HTTP: The Web’s Foundation, describes the core technology of HTTP, the
foundation of the Web, in four chapters:
• Chapter 1, Overview of HTTP, is a rapid-paced overview of HTTP.
• Chapter 2, URLs and Resources, details the formats of uniform resource locators
(URLs) and the various types of resources that URLs name across the Internet. It
also outlines the evolution to uniform resource names (URNs).
• Chapter 3, HTTP Messages, details how HTTP messages transport web content.
• Chapter 4, Connection Management, explains the commonly misunderstood and
poorly documented rules and behavior for managing HTTP connections.
Part II, HTTP Architecture, highlights the HTTP server, proxy, cache, gateway, and
robot applications that are the architectural building blocks of web systems. (Web
browsers are another building block, of course, but browsers already were covered
thoroughly in Part I of the book.) Part II contains the following six chapters:
• Chapter 5, Web Servers, gives an overview of web server architectures.
• Chapter 6, Proxies, explores HTTP proxy servers, which are intermediary serv-
ers that act as platforms for HTTP services and controls.
• Chapter 7, Caching, delves into the science of web caches—devices that improve
performance and reduce traffic by making local copies of popular documents.
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Preface | xv
• Chapter 8, Integration Points: Gateways, Tunnels, and Relays, explains gateways
and application servers that allow HTTP to work with software that speaks dif-
ferent protocols, including Secure Sockets Layer (SSL) encrypted protocols.
• Chapter 9, Web Robots, describes the various types of clients that pervade the
Web, including the ubiquitous browsers, robots and spiders, and search engines.
• Chapter 10, HTTP-NG, talks about HTTP developments still in the works: the
HTTP-NG protocol.
Part III, Identification, Authorization, and Security, presents a suite of techniques and
technologies to track identity, enforce security, and control access to content. It con-
tains the following four chapters:
• Chapter 11, Client Identification and Cookies, talks about techniques to identify
users so that content can be personalized to the user audience.
• Chapter 12, Basic Authentication, highlights the basic mechanisms to verify user
identity. The chapter also examines how HTTP authentication interfaces with
databases.
• Chapter 13, Digest Authentication, explains digest authentication, a complex
proposed enhancement to HTTP that provides significantly enhanced security.
• Chapter 14, Secure HTTP, is a detailed overview of Internet cryptography, digi-
tal certificates, and SSL.
Part IV, Entities, Encodings, and Internationalization, focuses on the bodies of HTTP
messages (which contain the actual web content) and on the web standards that
describe and manipulate content stored in the message bodies. Part IV contains three
chapters:
• Chapter 15, Entities and Encodings, describes the structure of HTTP content.
• Chapter 16, Internationalization, surveys the web standards that allow users
around the globe to exchange content in different languages and character sets.
• Chapter 17, Content Negotiation and Transcoding, explains mechanisms for
negotiating acceptable content.
Part V, Content Publishing and Distribution, discusses the technology for publishing
and disseminating web content. It contains four chapters:
• Chapter 18, Web Hosting, discusses the ways people deploy servers in modern
web hosting environments and HTTP support for virtual web hosting.
• Chapter 19, Publishing Systems, discusses the technologies for creating web con-
tent and installing it onto web servers.
• Chapter 20, Redirection and Load Balancing, surveys the tools and techniques for
distributing incoming web traffic among a collection of servers.
• Chapter 21, Logging and Usage Tracking, covers log formats and common
questions.
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
xvi | Preface
Part VI, Appendixes, contains helpful reference appendixes and tutorials in related
technologies:
• Appendix A, URI Schemes, summarizes the protocols supported through uni-
form resource identifier (URI) schemes.
• Appendix B, HTTP Status Codes, conveniently lists the HTTP response codes.
• Appendix C, HTTP Header Reference, provides a reference list of HTTP header
fields.
• Appendix D, MIME Types, provides an extensive list of MIME types and
explains how MIME types are registered.
• Appendix E, Base-64 Encoding, explains base-64 encoding, used by HTTP
authentication.
• Appendix F, Digest Authentication, gives details on how to implement various
authentication schemes in HTTP.
• Appendix G, Language Tags, defines language tag values for HTTP language
headers.
• Appendix H, MIME Charset Registry, provides a detailed list of character encod-
ings, used for HTTP internationalization support.
Each chapter contains many examples and pointers to additional reference material.
Typographic Conventions
In this book, we use the following typographic conventions:
Italic
Used for URLs, C functions, command names, MIME types, new terms where
they are defined, and emphasis
Constant width
Used for computer output, code, and any literal text
Constant width bold
Used for user input
Comments and Questions
Please address comments and questions concerning this book to the publisher:
O’Reilly & Associates, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
(800) 998-9938 (in the United States or Canada)
(707) 829-0515 (international/local)
(707) 829-0104 (fax)
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Preface | xvii
There is a web page for this book, which lists errata, examples, or any additional
information. You can access this page at:
http://www.oreilly.com/catalog/httptdg/
To comment or ask technical questions about this book, send email to:
bookquestions@oreilly.com
For more information about books, conferences, Resource Centers, and the O’Reilly
Network, see the O’Reilly web site at:
http://www.oreilly.com
Acknowledgments
This book is the labor of many. The five authors would like to hold up a few people
in thanks for their significant contributions to this project.
To start, we’d like to thank Linda Mui, our editor at O’Reilly. Linda first met with
David and Brian way back in 1996, and she refined and steered several concepts into
the book you hold today. Linda also helped keep our wandering gang of first-time
book authors moving in a coherent direction and on a progressing (if not rapid) time-
line. Most of all, Linda gave us the chance to create this book. We’re very grateful.
We’d also like to thank several tremendously bright, knowledgeable, and kind souls
who devoted noteworthy energy to reviewing, commenting on, and correcting drafts
of this book. These include Tony Bourke, Sean Burke, Mike Chowla, Shernaz Daver,
Fred Douglis, Paula Ferguson, Vikas Jha, Yves Lafon, Peter Mattis, Chuck Neer-
daels, Luis Tavera, Duane Wessels, Dave Wu, and Marco Zagha. Their viewpoints
and suggestions have improved the book tremendously.
Rob Romano from O’Reilly created most of the amazing artwork you’ll find in this
book. The book contains an unusually large number of detailed illustrations that
make subtle concepts very clear. Many of these illustrations were painstakingly cre-
ated and revised numerous times. If a picture is worth a thousand words, Rob added
hundreds of pages of value to this book.
Brian would like to personally thank all of the authors for their dedication to this
project. A tremendous amount of time was invested by the authors in a challenge to
make the first detailed but accessible treatment of HTTP. Weddings, childbirths,
killer work projects, startup companies, and graduate schools intervened, but the
authors held together to bring this project to a successful completion. We believe the
result is worthy of everyone’s hard work and, most importantly, that it provides a
valuable service. Brian also would like to thank the employees of Inktomi for their
enthusiasm and support and for their deep insights about the use of HTTP in real-
world applications. Also, thanks to the fine folks at Cajun-shop.com for allowing us
to use their site for some of the examples in this book.
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
xviii | Preface
David would like to thank his family, particularly his mother and grandfather for
their ongoing support. He’d like to thank those that have put up with his erratic
schedule over the years writing the book. He’d also like to thank Slurp, Orctomi, and
Norma for everything they’ve done, and his fellow authors for all their hard work.
Finally, he would like to thank Brian for roping him into yet another adventure.
Marjorie would like to thank her husband, Alan Liu, for technical insight, familial
support and understanding. Marjorie thanks her fellow authors for many insights
and inspirations. She is grateful for the experience of working together on this book.
Sailu would like to thank David and Brian for the opportunity to work on this book,
and Chuck Neerdaels for introducing him to HTTP.
Anshu would like to thank his wife, Rashi, and his parents for their patience, sup-
port, and encouragement during the long years spent writing this book.
Finally, the authors collectively thank the famous and nameless Internet pioneers,
whose research, development, and evangelism over the past four decades contrib-
uted so much to our scientific, social, and economic community. Without these
labors, there would be no subject for this book.
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
PART I
I. HTTP: The Web’s Foundation
This section is an introduction to the HTTP protocol. The next four chapters
describe the core technology of HTTP, the foundation of the Web:
• Chapter 1, Overview of HTTP, is a rapid-paced overview of HTTP.
• Chapter 2, URLs and Resources, details the formats of URLs and the various
types of resources that URLs name across the Internet. We also outline the evo-
lution to URNs.
• Chapter 3, HTTP Messages, details the HTTP messages that transport web
content.
• Chapter 4, Connection Management, discusses the commonly misunderstood
and poorly documented rules and behavior for managing TCP connections by
HTTP.
HTTP The Definitive Guide 1st Edition David Gourley
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
3
Chapter 1This is the Title of the Book CHAPTER 1
Overview of HTTP
The world’s web browsers, servers, and related web applications all talk to each
other through HTTP, the Hypertext Transfer Protocol. HTTP is the common lan-
guage of the modern global Internet.
This chapter is a concise overview of HTTP. You’ll see how web applications use
HTTP to communicate, and you’ll get a rough idea of how HTTP does its job. In
particular, we talk about:
• How web clients and servers communicate
• Where resources (web content) come from
• How web transactions work
• The format of the messages used for HTTP communication
• The underlying TCP network transport
• The different variations of the HTTP protocol
• Some of the many HTTP architectural components installed around the Internet
We’ve got a lot of ground to cover, so let’s get started on our tour of HTTP.
HTTP: The Internet’s Multimedia Courier
Billions of JPEG images, HTML pages, text files, MPEG movies, WAV audio files,
Java applets, and more cruise through the Internet each and every day. HTTP moves
the bulk of this information quickly, conveniently, and reliably from web servers all
around the world to web browsers on people’s desktops.
Because HTTP uses reliable data-transmission protocols, it guarantees that your data
will not be damaged or scrambled in transit, even when it comes from the other side of
the globe. This is good for you as a user, because you can access information without
worrying about its integrity. Reliable transmission is also good for you as an Internet
application developer, because you don’t have to worry about HTTP communications
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
4 | Chapter 1: Overview of HTTP
being destroyed, duplicated, or distorted in transit. You can focus on programming
the distinguishing details of your application, without worrying about the flaws and
foibles of the Internet.
Let’s look more closely at how HTTP transports the Web’s traffic.
Web Clients and Servers
Web content lives on web servers. Web servers speak the HTTP protocol, so they are
often called HTTP servers. These HTTP servers store the Internet’s data and provide
the data when it is requested by HTTP clients. The clients send HTTP requests to
servers, and servers return the requested data in HTTP responses, as sketched in
Figure 1-1. Together, HTTP clients and HTTP servers make up the basic compo-
nents of the World Wide Web.
You probably use HTTP clients every day. The most common client is a web
browser, such as Microsoft Internet Explorer or Netscape Navigator. Web browsers
request HTTP objects from servers and display the objects on your screen.
When you browse to a page, such as “http://www.oreilly.com/index.html,” your
browser sends an HTTP request to the server www.oreilly.com (see Figure 1-1). The
server tries to find the desired object (in this case, “/index.html”) and, if successful,
sends the object to the client in an HTTP response, along with the type of the object,
the length of the object, and other information.
Resources
Web servers host web resources. A web resource is the source of web content. The
simplest kind of web resource is a static file on the web server’s filesystem. These
files can contain anything: they might be text files, HTML files, Microsoft Word
files, Adobe Acrobat files, JPEG image files, AVI movie files, or any other format you
can think of.
However, resources don’t have to be static files. Resources can also be software pro-
grams that generate content on demand. These dynamic content resources can gen-
erate content based on your identity, on what information you’ve requested, or on
Figure 1-1. Web clients and servers
HTTP request
“Get me the document called /index.html.”
Client Server
www.oreilly.com
HTTP response
“Okay,here it is,it’s in HTML format and is 3,150 characters long.”
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Resources | 5
the time of day. They can show you a live image from a camera, or let you trade
stocks, search real estate databases, or buy gifts from online stores (see Figure 1-2).
In summary, a resource is any kind of content source. A file containing your com-
pany’s sales forecast spreadsheet is a resource. A web gateway to scan your local
public library’s shelves is a resource. An Internet search engine is a resource.
Media Types
Because the Internet hosts many thousands of different data types, HTTP carefully
tags each object being transported through the Web with a data format label called a
MIME type. MIME (Multipurpose Internet Mail Extensions) was originally designed
to solve problems encountered in moving messages between different electronic mail
systems. MIME worked so well for email that HTTP adopted it to describe and label
its own multimedia content.
Web servers attach a MIME type to all HTTP object data (see Figure 1-3). When a
web browser gets an object back from a server, it looks at the associated MIME type
to see if it knows how to handle the object. Most browsers can handle hundreds of
popular object types: displaying image files, parsing and formatting HTML files,
playing audio files through the computer’s speakers, or launching external plug-in
software to handle special formats.
Figure 1-2. A web resource is anything that provides web content
Client Server
Internet
E-commerce
gateway
Realestatesearch
gateway
Stocktrading
gateway
Webcam
gateway
11000101101
Imagefile
Textfile
Filesystem Resources
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
6 | Chapter 1: Overview of HTTP
A MIME type is a textual label, represented as a primary object type and a specific
subtype, separated by a slash. For example:
• An HTML-formatted text document would be labeled with type text/html.
• A plain ASCII text document would be labeled with type text/plain.
• A JPEG version of an image would be image/jpeg.
• A GIF-format image would be image/gif.
• An Apple QuickTime movie would be video/quicktime.
• A Microsoft PowerPoint presentation would be application/vnd.ms-powerpoint.
There are hundreds of popular MIME types, and many more experimental or limited-
use types. A very thorough MIME type list is provided in Appendix D.
URIs
Each web server resource has a name, so clients can point out what resources they
are interested in. The server resource name is called a uniform resource identifier, or
URI. URIs are like the postal addresses of the Internet, uniquely identifying and
locating information resources around the world.
Here’s a URI for an image resource on Joe’s Hardware store’s web server:
http://www.joes-hardware.com/specials/saw-blade.gif
Figure 1-4 shows how the URI specifies the HTTP protocol to access the saw-blade
GIF resource on Joe’s store’s server. Given the URI, HTTP can retrieve the object.
URIs come in two flavors, called URLs and URNs. Let’s take a peek at each of these
types of resource identifiers now.
URLs
The uniform resource locator (URL) is the most common form of resource identifier.
URLs describe the specific location of a resource on a particular server. They tell you
exactly how to fetch a resource from a precise, fixed location. Figure 1-4 shows how
a URL tells precisely where a resource is located and how to access it. Table 1-1
shows a few examples of URLs.
Figure 1-3. MIME types are sent back with the data content
Client Server
Content-type: image/jpeg
Content-length: 12984
MIMEtype
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Resources | 7
Most URLs follow a standardized format of three main parts:
• The first part of the URL is called the scheme, and it describes the protocol used
to access the resource. This is usually the HTTP protocol (http://).
• The second part gives the server Internet address (e.g., www.joes-hardware.com).
• The rest names a resource on the web server (e.g., /specials/saw-blade.gif ).
Today, almost every URI is a URL.
URNs
The second flavor of URI is the uniform resource name, or URN. A URN serves as a
unique name for a particular piece of content, independent of where the resource
currently resides. These location-independent URNs allow resources to move from
place to place. URNs also allow resources to be accessed by multiple network access
protocols while maintaining the same name.
For example, the following URN might be used to name the Internet standards docu-
ment “RFC 2141” regardless of where it resides (it may even be copied in several
places):
urn:ietf:rfc:2141
Figure 1-4. URLs specify protocol, server, and local resource
Table 1-1. Example URLs
URL Description
http://www.oreilly.com/index.html The home URL for O’Reilly & Associates, Inc.
http://www.yahoo.com/images/logo.gif The URL for the Yahoo! web site’s logo
http://www.joes-hardware.com/inventory-check.
cgi?item=12731
The URL for a program that checks if inventory item
#12731 is in stock
ftp://joe:tools4u@ftp.joes-hardware.com/locking-
pliers.gif
The URL for the locking-pliers.gif image file, using
password-protected FTP as the access protocol
Client www.joes-hardware.com
Content-type: image/gif
Content-length: 8572
http://www.joes-hardware.com/specials/saw-blade.gif
UseHTTPprotocol Gotowww.joes-hardware.com Grabtheresourcecalled/specials/saw-blade.gif
1 2 3
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
8 | Chapter 1: Overview of HTTP
URNs are still experimental and not yet widely adopted. To work effectively, URNs
need a supporting infrastructure to resolve resource locations; the lack of such an
infrastructure has also slowed their adoption. But URNs do hold some exciting
promise for the future. We’ll discuss URNs in a bit more detail in Chapter 2, but
most of the remainder of this book focuses almost exclusively on URLs.
Unless stated otherwise, we adopt the conventional terminology and use URI and
URL interchangeably for the remainder of this book.
Transactions
Let’s look in more detail how clients use HTTP to transact with web servers and
their resources. An HTTP transaction consists of a request command (sent from cli-
ent to server), and a response result (sent from the server back to the client). This
communication happens with formatted blocks of data called HTTP messages, as
illustrated in Figure 1-5.
Methods
HTTP supports several different request commands, called HTTP methods. Every
HTTP request message has a method. The method tells the server what action to per-
form (fetch a web page, run a gateway program, delete a file, etc.). Table 1-2 lists five
common HTTP methods.
Figure 1-5. HTTP transactions consist of request and response messages
Table 1-2. Some common HTTP methods
HTTP method Description
GET Send named resource from the server to the client.
PUT Store data from client into a named server resource.
Internet
HTTPrequestmessagecontains
thecommandandtheURI
GET /specials/saw-blade.gif HTTP/1.0
Host: www.joes-hardware.com
Client www.joes-hardware.com
HTTP/1.0 200 OK
Content-type: image/gif
Content-length: 8572 HTTPresponsemessagecontains
theresultofthetransaction
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Transactions | 9
We’ll discuss HTTP methods in detail in Chapter 3.
Status Codes
Every HTTP response message comes back with a status code. The status code is a
three-digit numeric code that tells the client if the request succeeded, or if other
actions are required. A few common status codes are shown in Table 1-3.
HTTP also sends an explanatory textual “reason phrase” with each numeric status
code (see the response message in Figure 1-5). The textual phrase is included only for
descriptive purposes; the numeric code is used for all processing.
The following status codes and reason phrases are treated identically by HTTP soft-
ware:
200 OK
200 Document attached
200 Success
200 All’s cool, dude
HTTP status codes are explained in detail in Chapter 3.
Web Pages Can Consist of Multiple Objects
An application often issues multiple HTTP transactions to accomplish a task. For
example, a web browser issues a cascade of HTTP transactions to fetch and display a
graphics-rich web page. The browser performs one transaction to fetch the HTML
“skeleton” that describes the page layout, then issues additional HTTP transactions
for each embedded image, graphics pane, Java applet, etc. These embedded
resources might even reside on different servers, as shown in Figure 1-6. Thus, a
“web page” often is a collection of resources, not a single resource.
DELETE Delete the named resource from a server.
POST Send client data into a server gateway application.
HEAD Send just the HTTP headers from the response for the named resource.
Table 1-3. Some common HTTP status codes
HTTP status code Description
200 OK. Document returned correctly.
302 Redirect. Go someplace else to get the resource.
404 Not Found. Can’t find this resource.
Table 1-2. Some common HTTP methods (continued)
HTTP method Description
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
10 | Chapter 1: Overview of HTTP
Messages
Now let’s take a quick look at the structure of HTTP request and response mes-
sages. We’ll study HTTP messages in exquisite detail in Chapter 3.
HTTP messages are simple, line-oriented sequences of characters. Because they are
plain text, not binary, they are easy for humans to read and write.* Figure 1-7 shows
the HTTP messages for a simple transaction.
HTTP messages sent from web clients to web servers are called request messages.
Messages from servers to clients are called response messages. There are no other
kinds of HTTP messages. The formats of HTTP request and response messages are
very similar.
Figure 1-6. Composite web pages require separate HTTP transactions for each embedded resource
* Some programmers complain about the difficulty of HTTP parsing, which can be tricky and error-prone,
especially when designing high-speed software. A binary format or a more restricted text format might have
been simpler to process, but most HTTP programmers appreciate HTTP’s extensibility and debuggability.
Figure 1-7. HTTP messages have a simple, line-oriented text structure
Client
Server 1
Server 2
Internet
GET /test/hi-there.txt HTTP/1.0
Accept: text/*
Accept-Language: en,fr
HTTP/1.0 200 OK
Content-type: text/plain
Content-length: 19
Hi! I’m a message!
Startline
Headers
Body
(a) Request message (b) Response message
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Connections | 11
HTTP messages consist of three parts:
Start line
The first line of the message is the start line, indicating what to do for a request
or what happened for a response.
Header fields
Zero or more header fields follow the start line. Each header field consists of a
name and a value, separated by a colon (:) for easy parsing. The headers end
with a blank line. Adding a header field is as easy as adding another line.
Body
After the blank line is an optional message body containing any kind of data.
Request bodies carry data to the web server; response bodies carry data back to
the client. Unlike the start lines and headers, which are textual and structured,
the body can contain arbitrary binary data (e.g., images, videos, audio tracks,
software applications). Of course, the body can also contain text.
Simple Message Example
Figure 1-8 shows the HTTP messages that might be sent as part of a simple transac-
tion. The browser requests the resource http://www.joes-hardware.com/tools.html.
In Figure 1-8, the browser sends an HTTP request message. The request has a GET
method in the start line, and the local resource is /tools.html. The request indicates it
is speaking Version 1.0 of the HTTP protocol. The request message has no body,
because no request data is needed to GET a simple document from a server.
The server sends back an HTTP response message. The response contains the HTTP
version number (HTTP/1.0), a success status code (200), a descriptive reason phrase
(OK), and a block of response header fields, all followed by the response body con-
taining the requested document. The response body length is noted in the Content-
Length header, and the document’s MIME type is noted in the Content-Type
header.
Connections
Now that we’ve sketched what HTTP’s messages look like, let’s talk for a moment
about how messages move from place to place, across Transmission Control Protocol
(TCP) connections.
TCP/IP
HTTP is an application layer protocol. HTTP doesn’t worry about the nitty-gritty
details of network communication; instead, it leaves the details of networking to
TCP/IP, the popular reliable Internet transport protocol.
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
12 | Chapter 1: Overview of HTTP
TCP provides:
• Error-free data transportation
• In-order delivery (data will always arrive in the order in which it was sent)
• Unsegmented data stream (can dribble out data in any size at any time)
The Internet itself is based on TCP/IP, a popular layered set of packet-switched net-
work protocols spoken by computers and network devices around the world. TCP/IP
hides the peculiarities and foibles of individual networks and hardware, letting com-
puters and networks of any type talk together reliably.
Once a TCP connection is established, messages exchanged between the client and
server computers will never be lost, damaged, or received out of order.
In networking terms, the HTTP protocol is layered over TCP. HTTP uses TCP to
transport its message data. Likewise, TCP is layered over IP (see Figure 1-9).
Figure 1-8. Example GET transaction for http://www.joes-hardware.com/tools.html
GET /tools.html HTTP/1.0
User-agent: Mozilla/4.75 [en] (Win98; U)
Host: www.joes-hardware.com
Accept: text/html, image/gif, image/jpeg
Accept-language: en
HTTP/1.0 200 OK
Date: Sun, o1 Oct 2000 23:25:17 GMT
Server: Apache/1.3.11 BSafe-SSL/1.38 (Unix)
Last-modified: Tue, 04 Jul 2000 09:46:21 GMT
Content-length: 403
Content-type: text/html
<HTML>
<HEAD><TITLE>Joe’s Tools</TITLE></HEAD>
<BODY>
<H1>Tools Page</H1>
<H2>Hammers</H2>
<P>Joe’s Hardware Online has the largest selection of
hammers on the earth.</P>
<H2><A NAME=drills></A>Drills</H2>
<P>Joe’s Hardware has a complete line of cordless
and corded drills, as well as the latest in
plutonium-powered atomic drills, for those big
around the house jobs./<P>...
</BODY>
</HTML>
Client www.joes-hardware.com
(a) Request message
(b) Response message
Requeststartline(command)
Requestheaders
Norequestbody
Responsestartline
(status)
Responseheaders
Responsebody
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Connections | 13
Connections, IP Addresses, and Port Numbers
Before an HTTP client can send a message to a server, it needs to establish a TCP/IP
connection between the client and server using Internet protocol (IP) addresses and
port numbers.
Setting up a TCP connection is sort of like calling someone at a corporate office.
First, you dial the company’s phone number. This gets you to the right organization.
Then, you dial the specific extension of the person you’re trying to reach.
In TCP, you need the IP address of the server computer and the TCP port number
associated with the specific software program running on the server.
This is all well and good, but how do you get the IP address and port number of the
HTTP server in the first place? Why, the URL, of course! We mentioned before that
URLs are the addresses for resources, so naturally enough they can provide us with
the IP address for the machine that has the resource. Let’s take a look at a few URLs:
http://207.200.83.29:80/index.html
http://www.netscape.com:80/index.html
http://www.netscape.com/index.html
The first URL has the machine’s IP address, “207.200.83.29”, and port number,
“80”.
The second URL doesn’t have a numeric IP address; it has a textual domain name, or
hostname (“www.netscape.com”). The hostname is just a human-friendly alias for an
IP address. Hostnames can easily be converted into IP addresses through a facility
called the Domain Name Service (DNS), so we’re all set here, too. We will talk much
more about DNS and URLs in Chapter 2.
The final URL has no port number. When the port number is missing from an HTTP
URL, you can assume the default value of port 80.
With the IP address and port number, a client can easily communicate via TCP/IP.
Figure 1-10 shows how a browser uses HTTP to display a simple HTML resource
that resides on a distant server.
Figure 1-9. HTTP network protocol stack
HTTP Applicationlayer
TCP Transportlayer
IP Networklayer
Network-specific link interface Datalinklayer
Physical network hardware Physicallayer
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
14 | Chapter 1: Overview of HTTP
Here are the steps:
(a) The browser extracts the server’s hostname from the URL.
(b) The browser converts the server’s hostname into the server’s IP address.
(c) The browser extracts the port number (if any) from the URL.
(d) The browser establishes a TCP connection with the web server.
(e) The browser sends an HTTP request message to the server.
(f) The server sends an HTTP response back to the browser.
(g) The connection is closed, and the browser displays the document.
Figure 1-10. Basic browser connection process
Client Server
Internet
(d) Connect to 161.58.228.45 port 80
Client Server
Internet
(e) Send an HTTP GET request
Client Server
Internet
(f) Read HTTP response from server
Client Server
Internet
(g) Close the connection
Screen shot needed
User types in URL
http://www.joes-hardware.com:80/tools.html
(c) Get the port number (80)
www.joes-hardware.com
(a) Get the hostname
(b) DNS
Browsershowingpage
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Connections | 15
A Real Example Using Telnet
Because HTTP uses TCP/IP, and is text-based, as opposed to using some obscure
binary format, it is simple to talk directly to a web server.
The Telnet utility connects your keyboard to a destination TCP port and connects
the TCP port output back to your display screen. Telnet is commonly used for
remote terminal sessions, but it can generally connect to any TCP server, including
HTTP servers.
You can use the Telnet utility to talk directly to web servers. Telnet lets you open a
TCP connection to a port on a machine and type characters directly into the port.
The web server treats you as a web client, and any data sent back on the TCP con-
nection is displayed onscreen.
Let’s use Telnet to interact with a real web server. We will use Telnet to fetch the
document pointed to by the URL http://www.joes-hardware.com:80/tools.html (you
can try this example yourself).
Let’s review what should happen:
• First, we need to look up the IP address of www.joes-hardware.com and open a
TCP connection to port 80 on that machine. Telnet does this legwork for us.
• Once the TCP connection is open, we need to type in the HTTP request.
• When the request is complete (indicated by a blank line), the server should send
back the content in an HTTP response and close the connection.
Our example HTTP request for http://www.joes-hardware.com:80/tools.html is shown
in Example 1-1. What we typed is shown in boldface.
Example 1-1. An HTTP transaction using telnet
% telnet www.joes-hardware.com 80
Trying 161.58.228.45...
Connected to joes-hardware.com.
Escape character is '^]'.
GET /tools.html HTTP/1.1
Host: www.joes-hardware.com
HTTP/1.1 200 OK
Date: Sun, 01 Oct 2000 23:25:17 GMT
Server: Apache/1.3.11 BSafe-SSL/1.38 (Unix) FrontPage/4.0.4.3
Last-Modified: Tue, 04 Jul 2000 09:46:21 GMT
ETag: "373979-193-3961b26d"
Accept-Ranges: bytes
Content-Length: 403
Connection: close
Content-Type: text/html
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
16 | Chapter 1: Overview of HTTP
Telnet looks up the hostname and opens a connection to the www.joes-hardware.com
web server, which is listening on port 80. The three lines after the command are out-
put from Telnet, telling us it has established a connection.
We then type in our basic request command, “GET /tools.html HTTP/1.1”, and send
a Host header providing the original hostname, followed by a blank line, asking the
server to GET us the resource “/tools.html” from the server www.joes-hardware.com.
After that, the server responds with a response line, several response headers, a blank
line, and finally the body of the HTML document.
Beware that Telnet mimics HTTP clients well but doesn’t work well as a server.
And automated Telnet scripting is no fun at all. For a more flexible tool, you
might want to check out nc (netcat). The nc tool lets you easily manipulate and
script UDP- and TCP-based traffic, including HTTP. See http://netcat.
sourceforge.net for details.
Protocol Versions
There are several versions of the HTTP protocol in use today. HTTP applications
need to work hard to robustly handle different variations of the HTTP protocol. The
versions in use are:
HTTP/0.9
The 1991 prototype version of HTTP is known as HTTP/0.9. This protocol con-
tains many serious design flaws and should be used only to interoperate with
legacy clients. HTTP/0.9 supports only the GET method, and it does not sup-
port MIME typing of multimedia content, HTTP headers, or version numbers.
HTTP/0.9 was originally defined to fetch simple HTML objects. It was soon
replaced with HTTP/1.0.
HTTP/1.0
1.0 was the first version of HTTP that was widely deployed. HTTP/1.0 added
version numbers, HTTP headers, additional methods, and multimedia object
handling. HTTP/1.0 made it practical to support graphically appealing web
<HTML>
<HEAD><TITLE>Joe's Tools</TITLE></HEAD>
<BODY>
<H1>Tools Page</H1>
<H2>Hammers</H2>
<P>Joe's Hardware Online has the largest selection of hammers on the earth.</P>
<H2><A NAME=drills></A>Drills</H2>
<P>Joe's Hardware has a complete line of cordless and corded drills, as well as the latest
in plutonium-powered atomic drills, for those big around the house jobs.</P> ...
</BODY>
</HTML>
Connection closed by foreign host.
Example 1-1. An HTTP transaction using telnet (continued)
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Architectural Components of the Web | 17
pages and interactive forms, which helped promote the wide-scale adoption of
the World Wide Web. This specification was never well specified. It represented
a collection of best practices in a time of rapid commercial and academic evolu-
tion of the protocol.
HTTP/1.0+
Many popular web clients and servers rapidly added features to HTTP in the
mid-1990s to meet the demands of a rapidly expanding, commercially success-
ful World Wide Web. Many of these features, including long-lasting “keep-
alive” connections, virtual hosting support, and proxy connection support, were
added to HTTP and became unofficial, de facto standards. This informal,
extended version of HTTP is often referred to as HTTP/1.0+.
HTTP/1.1
HTTP/1.1 focused on correcting architectural flaws in the design of HTTP, spec-
ifying semantics, introducing significant performance optimizations, and remov-
ing mis-features. HTTP/1.1 also included support for the more sophisticated
web applications and deployments that were under way in the late 1990s.
HTTP/1.1 is the current version of HTTP.
HTTP-NG (a.k.a. HTTP/2.0)
HTTP-NG is a prototype proposal for an architectural successor to HTTP/1.1
that focuses on significant performance optimizations and a more powerful frame-
work for remote execution of server logic. The HTTP-NG research effort con-
cluded in 1998, and at the time of this writing, there are no plans to advance this
proposal as a replacement for HTTP/1.1. See Chapter 10 for more information.
Architectural Components of the Web
In this overview chapter, we’ve focused on how two web applications (web browsers
and web servers) send messages back and forth to implement basic transactions.
There are many other web applications that you interact with on the Internet. In this
section, we’ll outline several other important applications, including:
Proxies
HTTP intermediaries that sit between clients and servers
Caches
HTTP storehouses that keep copies of popular web pages close to clients
Gateways
Special web servers that connect to other applications
Tunnels
Special proxies that blindly forward HTTP communications
Agents
Semi-intelligent web clients that make automated HTTP requests
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
18 | Chapter 1: Overview of HTTP
Proxies
Let’s start by looking at HTTP proxy servers, important building blocks for web
security, application integration, and performance optimization.
As shown in Figure 1-11, a proxy sits between a client and a server, receiving all of
the client’s HTTP requests and relaying the requests to the server (perhaps after
modifying the requests). These applications act as a proxy for the user, accessing the
server on the user’s behalf.
Proxies are often used for security, acting as trusted intermediaries through which all
web traffic flows. Proxies can also filter requests and responses; for example, to
detect application viruses in corporate downloads or to filter adult content away
from elementary-school students. We’ll talk about proxies in detail in Chapter 6.
Caches
A web cache or caching proxy is a special type of HTTP proxy server that keeps cop-
ies of popular documents that pass through the proxy. The next client requesting the
same document can be served from the cache’s personal copy (see Figure 1-12).
Figure 1-11. Proxies relay traffic between client and server
Figure 1-12. Caching proxies keep local copies of popular documents to improve performance
Client Server
Internet
Proxy
Client Server
Internet
Proxy cache
Client
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Architectural Components of the Web | 19
A client may be able to download a document much more quickly from a nearby
cache than from a distant web server. HTTP defines many facilities to make caching
more effective and to regulate the freshness and privacy of cached content. We cover
caching technology in Chapter 7.
Gateways
Gateways are special servers that act as intermediaries for other servers. They are
often used to convert HTTP traffic to another protocol. A gateway always receives
requests as if it was the origin server for the resource. The client may not be aware it
is communicating with a gateway.
For example, an HTTP/FTP gateway receives requests for FTP URIs via HTTP
requests but fetches the documents using the FTP protocol (see Figure 1-13). The
resulting document is packed into an HTTP message and sent to the client. We dis-
cuss gateways in Chapter 8.
Tunnels
Tunnels are HTTP applications that, after setup, blindly relay raw data between two
connections. HTTP tunnels are often used to transport non-HTTP data over one or
more HTTP connections, without looking at the data.
One popular use of HTTP tunnels is to carry encrypted Secure Sockets Layer (SSL)
traffic through an HTTP connection, allowing SSL traffic through corporate fire-
walls that permit only web traffic. As sketched in Figure 1-14, an HTTP/SSL tunnel
receives an HTTP request to establish an outgoing connection to a destination
address and port, then proceeds to tunnel the encrypted SSL traffic over the HTTP
channel so that it can be blindly relayed to the destination server.
Agents
User agents (or just agents) are client programs that make HTTP requests on the
user’s behalf. Any application that issues web requests is an HTTP agent. So far,
we’ve talked about only one kind of HTTP agent: web browsers. But there are many
other kinds of user agents.
Figure 1-13. HTTP/FTP gateway
HTTP client FTP server
HTTP/FTP
gateway
HTTP FTP
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
20 | Chapter 1: Overview of HTTP
For example, there are machine-automated user agents that autonomously wander
the Web, issuing HTTP transactions and fetching content, without human supervi-
sion. These automated agents often have colorful names, such as “spiders” or “web
robots” (see Figure 1-15). Spiders wander the Web to build useful archives of web
content, such as a search engine’s database or a product catalog for a comparison-
shopping robot. See Chapter 9 for more information.
Figure 1-14. Tunnels forward data across non-HTTP networks (HTTP/SSL tunnel shown)
Figure 1-15. Automated search engine “spiders” are agents, fetching web pages around the world
Server
Client
SSL
Tunnelstart
SSL
HTTP HTTP
connection SSL
HTTP
SSL
Tunnelendpoint
Port80
SSL
connection SSL
P
o
r
t
4
4
3
Searchengine
“spider”
Web server
Web server
Web server
Search engine
database
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
For More Information | 21
The End of the Beginning
That’s it for our quick introduction to HTTP. In this chapter, we highlighted HTTP’s
role as a multimedia transport protocol. We outlined how HTTP uses URIs to name
multimedia resources on remote servers, we sketched how HTTP request and
response messages are used to manipulate multimedia resources on remote servers,
and we finished by surveying a few of the web applications that use HTTP.
The remaining chapters explain the technical machinery of the HTTP protocol,
applications, and resources in much more detail.
For More Information
Later chapters of this book will explore HTTP in much more detail, but you might
find that some of the following sources contain useful background about particular
topics we covered in this chapter.
HTTP Protocol Information
HTTP Pocket Reference
Clinton Wong, O’Reilly & Associates, Inc. This little book provides a concise
introduction to HTTP and a quick reference to each of the headers and status
codes that compose HTTP transactions.
http://www.w3.org/Protocols/
This W3C web page contains many great links about the HTTP protocol.
http://www.ietf.org/rfc/rfc2616.txt
RFC 2616, “Hypertext Transfer Protocol—HTTP/1.1,” is the official specifica-
tion for HTTP/1.1, the current version of the HTTP protocol. The specification
is a well-written, well-organized, detailed reference for HTTP, but it isn’t ideal
for readers who want to learn the underlying concepts and motivations of HTTP
or the differences between theory and practice. We hope that this book fills in
the underlying concepts, so you can make better use of the specification.
http://www.ietf.org/rfc/rfc1945.txt
RFC 1945, “Hypertext Transfer Protocol—HTTP/1.0,” is an informational RFC
that describes the modern foundation for HTTP. It details the officially sanc-
tioned and “best-practice” behavior of web applications at the time the specifica-
tion was written. It also contains some useful descriptions about behavior that is
deprecated in HTTP/1.1 but still widely implemented by legacy applications.
http://www.w3.org/Protocols/HTTP/AsImplemented.html
This web page contains a description of the 1991 HTTP/0.9 protocol, which
implements only GET requests and has no content typing.
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
22 | Chapter 1: Overview of HTTP
Historical Perspective
http://www.w3.org/Protocols/WhyHTTP.html
This brief web page from 1991, from the author of HTTP, highlights some of the
original, minimalist goals of HTTP.
http://www.w3.org/History.html
“A Little History of the World Wide Web” gives a short but interesting perspec-
tive on some of the early goals and foundations of the World Wide Web and
HTTP.
http://www.w3.org/DesignIssues/Architecture.html
“Web Architecture from 50,000 Feet” paints a broad, ambitious view of the
World Wide Web and the design principles that affect HTTP and related web
technologies.
Other World Wide Web Information
http://www.w3.org
The World Wide Web Consortium (W3C) is the technology steering team for
the Web. The W3C develops interoperable technologies (specifications, guide-
lines, software, and tools) for the evolving Web. The W3C site is a treasure trove
of introductory and detailed documentation about web technologies.
http://www.ietf.org/rfc/rfc2396.txt
RFC 2396, “Uniform Resource Identifiers (URI): Generic Syntax,” is the detailed
reference for URIs and URLs.
http://www.ietf.org/rfc/rfc2141.txt
RFC 2141, “URN Syntax,” is a 1997 specification describing URN syntax.
http://www.ietf.org/rfc/rfc2046.txt
RFC 2046, “MIME Part 2: Media Types,” is the second in a suite of five Internet
specifications defining the Multipurpose Internet Mail Extensions standard for
multimedia content management.
http://www.wrec.org/Drafts/draft-ietf-wrec-taxonomy-06.txt
This Internet draft, “Internet Web Replication and Caching Taxonomy,” speci-
fies standard terminology for web architectural components.
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
23
Chapter 2This is the Title of the Book CHAPTER 2
URLs and Resources
Think of the Internet as a giant, expanding city, full of places to see and things to do.
You and the other residents and tourists of this booming community would use stan-
dard naming conventions for the city’s vast attractions and services. You’d use street
addresses for museums, restaurants, and people’s homes. You’d use phone numbers
for the fire department, the boss’s secretary, and your mother, who says you don’t
call enough.
Everything has a standardized name, to help sort out the city’s resources. Books have
ISBN numbers, buses have route numbers, bank accounts have account numbers,
and people have social security numbers. Tomorrow you will meet your business
partners at gate 31 of the airport. Every morning you take a Red-line train and exit at
Kendall Square station.
And because everyone agreed on standards for these different names, we can easily
share the city’s treasures with each other. You can tell the cab driver to take you to
246 McAllister Street, and he’ll know what you mean (even if he takes the long way).
Uniform resource locators (URLs) are the standardized names for the Internet’s
resources. URLs point to pieces of electronic information, telling you where they are
located and how to interact with them.
In this chapter, we’ll cover:
• URL syntax and what the various URL components mean and do
• URL shortcuts that many web clients support, including relative URLs and
expandomatic URLs
• URL encoding and character rules
• Common URL schemes that support a variety of Internet information systems
• The future of URLs, including uniform resource names (URNs)—a framework
to support objects that move from place to place while retaining stable names
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
24 | Chapter 2: URLs and Resources
Navigating the Internet’s Resources
URLs are the resource locations that your browser needs to find information. They
let people and applications find, use, and share the billions of data resources on the
Internet. URLs are the usual human access point to HTTP and other protocols: a
person points a browser at a URL and, behind the scenes, the browser sends the
appropriate protocol messages to get the resource that the person wants.
URLs actually are a subset of a more general class of resource identifier called a uni-
form resource identifier, or URI. URIs are a general concept comprised of two main
subsets, URLs and URNs. URLs identify resources by describing where resources are
located, whereas URNs (which we’ll cover later in this chapter) identify resources by
name, regardless of where they currently reside.
The HTTP specification uses the more general concept of URIs as its resource identi-
fiers; in practice, however, HTTP applications deal only with the URL subset of
URIs. Throughout this book, we’ll sometimes refer to URIs and URLs interchange-
ably, but we’re almost always talking about URLs.
Say you want to fetch the URL http://www.joes-hardware.com/seasonal/index-fall.html:
• The first part of the URL (http) is the URL scheme. The scheme tells a web client
how to access the resource. In this case, the URL says to use the HTTP protocol.
• The second part of the URL (www.joes-hardware.com) is the server location.
This tells the web client where the resource is hosted.
• The third part of the URL (/seasonal/index-fall.html) is the resource path. The
path tells what particular local resource on the server is being requested.
See Figure 2-1 for an illustration.
URLs can direct you to resources available through protocols other than HTTP.
They can point you to any resource on the Internet, from a person’s email account:
mailto:president@whitehouse.gov
Figure 2-1. How URLs relate to browser, machine, server, and location on the server’s filesystem
http://www.joes-hardware.com/seasonal/index-fall.html
Client Server Disk
Scheme
(how)
Host
(where)
Path
(what)
Webpage
index-fall.html
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Navigating the Internet’s Resources | 25
to files that are available through other protocols, such as the File Transfer Protocol
(FTP):
ftp://ftp.lots-o-books.com/pub/complete-price-list.xls
to movies hosted off of streaming video servers:
rtsp://www.joes-hardware.com:554/interview/cto_video
URLs provide a way to uniformly name resources. Most URLs have the same
“scheme://server location/path” structure. So, for every resource out there and every
way to get those resources, you have a single way to name each resource so that any-
one can use that name to find it. However, this wasn’t always the case.
The Dark Days Before URLs
Before the Web and URLs, people relied on a rag-tag assortment of applications to
access data distributed throughout the Net. Most people were not lucky enough to
have all the right applications or were not savvy and patient enough to use them.
Before URLs came along, if you wanted to share the complete-catalog.xls file with a
friend, you would have had to say something like this: “Use FTP to connect to ftp.
joes-hardware.com. Log in as anonymous. Then type your username as the password.
Change to the pub directory. Switch to binary mode. Now download the file named
complete-catalog.xls to your local filesystem and view it there.”
Today, browsers such as Netscape Navigator and Microsoft Internet Explorer bun-
dle much of this functionality into one convenient package. Using URLs, these appli-
cations are able to access many resources in a uniform way, through one interface.
Instead of the complicated instructions above, you could just say “Point your
browser at ftp://ftp.lots-o-books.com/pub/complete-catalog.xls.”
URLs have provided a means for applications to be aware of how to access a
resource. In fact, many users are probably unaware of the protocols and access meth-
ods their browsers use to get the resources they are requesting.
With web browsers, you no longer need a news reader to read Internet news or an
FTP client to access files on FTP servers. You don’t need an electronic mail program
to send and receive email messages. URLs have helped to simplify the online world,
by allowing the browser to be smart about how to access and handle resources.*
Applications can use URLs to simplify access to information.
URLs give you and your browser all you need to find a piece of information. They
define the particular resource you want, where it is located, and how to get it.
* Browsers often use other applications to handle specific resources. For example, Internet Explorer launches
an email application to handle URLs that identify email resources.
Another Random Scribd Document
with Unrelated Content
Neppure in quest'anno andò esente il regno di Napoli dalle dure
pensioni della discordia, a cagion della guerra continuata fra i due re,
cioè fra Alfonso re d'Aragona e Renato d'Angiò. Povero era Renato,
e, mancandogli gente e pecunia [Giornal. Napolet., tom. 21 Rer. Ital.], cioè
i due maggiori requisiti a fare e sostenere la guerra, altra speranza
non avea se non in Antonio Caldora duca di Bari. Ma questi a quanti
messi gli mandava il re, affinchè cavalcasse in suo aiuto, adduceva
per iscusa la mancanza del danaro, e il timore che in sua lontananza
si ribellassero i popoli dell'Abbruzzo. Prese Renato allora l'ardita
risoluzione di portarsi incognito in persona in quelle contrade, e
l'eseguì con maraviglia d'ognuno. Raccolse in esso viaggio donativi,
danaro e gente, e massimamente dagli Aquilani. Trovavasi egli nel dì
29 di giugno in faccia all'esercito aragonese, e mandò ad Alfonso la
disfida della battaglia. La risposta dell'Aragonese fu, che, trovandosi
egli padrone della maggior parte del regno, non si sentiva voglia di
mettere a repentaglio tutta la sua fortuna in una giornata. Avrebbe
nondimeno Renato assalito il campo nemico, e probabilmente con
isperanza di vincerlo, perchè già si ritirava; ma l'infedele Caldora co'
suoi ricusò di muoversi. Per questo esacerbato Renato il fece
ritenere, e prese al suo soldo buona parte delle di lui milizie,
lasciandolo poscia tornare in Abbruzzo con titolo di vicerè. Ma in
vece di tornar colà il Caldora, cominciò a trattare accordo col re
Alfonso. Dio punì la sua infedeltà, perchè in questo mentre Gian-
Antonio Orsino principe di Taranto, già tornato alla divozione del re
Alfonso, tenne trattato con Marino da Norcia governatore di Bari pel
Caldora, ed entrò in possesso non solo di quella città, ma anche di
Conversano e di tutte le altre terre dei Caldoreschi. Tornò poscia il re
Alfonso colle sue genti all'assedio di Napoli, e però il re Renato,
quantunque avesse ricuperato castello Sant'Ermo, tornò ad essere in
disagio come prima, e ricorse a papa Eugenio per aiuto. Fin qui
erano state rispettate le città e terre degli Sforzeschi in regno di
Napoli, cioè quelle del conte Francesco e de' suoi fratelli. Il re
Alfonso, secondo i Giornali di Napoli, le prese nell'anno presente,
ancorchè fosse pace tra lui e il conte; e trovolle ricchissime per aver
esse goduto finora e profittato della loro neutralità. Erano queste
Benevento, Manfredonia, Bitonto ed altre non poche [Istor. Napolit.,
tom. 23 Rer. Ital.]: danno grave provenuto al conte Francesco per la
sua lontananza, avendo egli perduto il proprio per sostenere l'altrui.
Verisimilmente fu questo un sottomano del Visconte, che, per
vendicarsi d'esso Sforza, segretamente attizzò contra di lui il re
Alfonso. Il Simonetta [Simonetta, Vit. Francisci Sfortiae, lib. 5, tom. 21 Rer.
Ital.] differisce sino all'anno 1442 lo spoglio di tali città fatto al conte.
In mano d'esso re venne anche la città d'Aversa col sua castello.
Sigismondo Malatesta signore di Rimini [Cronica di Ferrara, tom. 24 Rer.
Ital.], per interposizione di Niccolò marchese di Ferrara, si ritirò
dall'amicizia del duca di Milano, e tornò a quella de' Veneziani: il che
fu cagione [Cronica di Rimini, tom. 15 Rer. Ital.] che anche Ravenna e i
Polentani facessero lo stesso nel dì 14 d'agosto.
Anno di
Cristo mccccxli. Indiz. iv.
Eugenio IV papa 11.
Federigo III re de' Romani 2.
Non mancarono affari neppure in quest'anno a papa Eugenio
[Raynaldus, Annal. Eccles. Spondanus, in Annal. Eccles. Æneas Sylvius, in Epist.],
perciocchè tuttavia lo scismatico concilio di Basilea, benchè
composto di poche teste, continuava le sue sessioni, e l'antipapa
Felice V, cioè Amedeo di Savoia, nel dì 24 di giugno, festa di san
Giovanni Batista, con gran solennità si fece coronare colla pontificia
tiara nella città di Basilea, dove fu gran concorso di gente, e creò
anche quattro cardinali. E benchè il re Alfonso non lasciasse
riconoscere per papa nei suoi regni il suddetto Amedeo, pure andava
trattando col concilio di Basilea, siccome sdegnato con papa
Eugenio, perchè questi ricusava di dargli l'investitura del regno di
Napoli. Anzi nel mese di ottobre, per far paura ad esso pontefice,
procurò che i prelati basiliensi inviassero a sè una ambasciata,
mostrando ancora di voler ottenere dall'antipapa ciò che il papa gli
andava negando. Ora Eugenio, non meno per queste ostilità
d'Alfonso, che per le preghiere del re Renato, si volse a raccogliere
quanti armati potè, e li spedì in regno di Napoli contra di Alfonso.
Prima non di meno che giugnessero tali soccorsi, erano succedute
alcune azioni vantaggiose al medesimo re d'Aragona [Giornal. Napol.,
tom. 21 Rer. Ital.]: cioè, accordatisi con lui i Caldoreschi, aveano
inalberate le di lui bandiere. Cassano, Biccari, Caiazza, la Padula ed
altre terre erano venute a sua divozione [Istoria di Napoli, tom. 23 Rer.
Ital.]. Ora da che il conte Francesco Sforza ebbe ragguaglio della
guerra mossa da esso Alfonso alle sue terre del regno di Napoli,
inviò colà Cesare Martinengo con Vittore Rangone, e con un grosso
corpo di cavalleria, il quale, unitosi con altre soldatesche della Marca,
col conte di Celano, con Francesco da San Severino ed altri
Napoletani [Simonetta, Vit. Francisci Sfortiae, lib. 6, tom. 21 Rer. Ital.], andò
ad opporsi ai progressi del re Alfonso. Si trovava allora esso re
all'assedio della città di Troia. Vennero le genti del conte Francesco
alle mani con lui nel dì 10 di giugno, e, dopo un crudel fatto d'armi,
n'ebbero la peggio con loro vergogna, ma senza gran danno, perchè
la maggior parte d'essi fuggendo si salvò nella suddetta città di
Troia, di maniera che fu forzato Alfonso dipoi a levarsi col campo di
sotto a quella città. Nel seguente luglio Alessandro Sforza,
governatore della Marca pel conte Francesco suo fratello, entrò
anch'egli nel regno con mille e cinquecento cavalli. Per trattato ebbe
il castello di Pescara; poscia all'improvviso arrivò addosso a
Raimondo Caldora, che assediava Ortona, e il fece prigione insieme
con cinquecento cavalli. Poco mancò che non pigliasse anche Riccio
e Giosia di casa Acqua viva. Ebbero questi la fortuna di salvarsi a
città di Chieti. Comparve poscia nel regno l'esercito pontifizio sotto il
comando del cardinale di Taranto legato, e del conte di Tagliacozzo,
consistente in circa dieci mila persone; ma non fece prodezza alcuna
degna di menzione. Anzi il cardinale da lì a qualche tempo fece
tregua col re Alfonso, e se ne tornò in Campagna di Roma. Questa fu
la rovina del re Renato [Bonincontrus, Annal., tom. 21 Rer. Ital.], perchè
Alfonso mandò tosto don Ferdinando suo figliuolo con grosso corpo
di combattenti a strignere d'assedio di bel nuovo Napoli, città che
scarseggiava allora e maggiormente seguitò a scarseggiare di viveri.
Avea certamente il papa a forza di danari fatto anche un armamento
di alcuni legni in Genova, per inviarli contra d'Alfonso; ma spese
malamente la pecunia, avendo mostrato i Genovesi voglia di far
molto, con poi far nulla.
Per conto della Lombardia, veggendosi Filippo Maria duca di
Milano in cattiva positura, per avere non solo perduti gli acquisti
fatti, ma parte ancora del suo nella guerra co' Veneziani, avea fin
dall'anno antecedente pregato Niccolò Estense marchese di Ferrara
ad interporsi per la pace, siccome principe neutrale, e che avea sì
buona mano in somiglianti affari [Sanuto, Istor. Venet., tom. 22 Rer. Ital.].
Andò il marchese per tal effetto a Venezia, passò anche a Mantova
per trattarne con quel marchese; nè solamente tenne filo di lettere
col conte Francesco Sforza, ma, con licenza de' Veneziani, andò
anche a trovarlo a Marmirolo. Una gran remora a questo affare era lo
stesso conte; laonde per guadagnarlo tornò il duca di Milano ad
esibirgli in moglie Bianca, unica naturale sua figlia, che seco portava
le speranze di tutta la sua eredità. E perchè non poteva il conte
prestar fede a chi più di una volta l'avea dianzi burlato, si trovò il
ripiego di mandar Bianca a Ferrara in deposito presso il marchese
Niccolò. Fu essa dunque condotta a Ferrara, dove come gran
principessa fece la sua entrata nel dì 26 di settembre [Cronica di
Ferrara, tom. 24 Rer. Ital.] sotto baldacchino di panno d'oro, e stelle poi
ad aspettare l'esito di sua ventura. Non so ben dire se per difetto del
duca, principe incostante nelle sue risoluzioni, e che per la venuta di
Niccolò Piccinino tornò ad alzare il capo, oppure per le pretensioni
de' Veneziani, vogliosi di qualche buon boccone, anche in questa
occasione andasse a terra la pratica della pace. Certo è che nel
verno di quest'anno si ricominciò la guerra, e del dì 5 d'aprile il
marchese Niccolò ricondusse Bianca a Milano, dopo aver perduta
ogni speranza di comporre le cose. Era già tornato nell'anno
precedente a Milano il suddetto Piccinino, ma quasi in farsetto; i suoi
soldati veterani il seguitarono quasi tutti a piedi, perchè ogni lor
sostanza avean perduto nella rotta d'Anghiari, essendo, come si è
detto altrove, secondo la disciplina militare degl'Italiani d'allora, in
uso di spogliar d'armi i soldati presi, e di lasciarli andare, con ritener
solamente le persone da taglia [Cristoforo da Soldo, Ist. Bresciana, tom. 21
Rer. Ital.]. Ancorchè la borsa del duca fosse estenuata affatto, pure si
trovarono gravezze e maniere di spremere quelle dei particolari,
tanto che il Piccinino si rimise in arnese, ed incoraggì il duca a nuove
militari imprese. Eccolo dunque in campagna nel dì 13 di febbraio
dell'anno presente passare il fiume Oglio con circa otto mila cavalli, e
tre mila fanti. Questo passaggio mise il terrore nelle milizie venete,
che svernavano nel Bresciano, e tutte si ritirarono alle fortezze
[Simonetta, Vit. Francis. Sfortiae, tom. eod.]. Mille cavalli del conte
Francesco si ridussero a Chiari. Fu loro addosso il Piccinino, e li prese
insieme colla terra; e ritenuti i capi di squadra, lasciò andare il resto
in bel giuppone. Non passò gran tempo che ricuperò tutta la
Geradadda, prese Palazzuolo, tutta la valle d'Iseo, il piano del
Bergamasco e gran parte del Bresciano: tanta era la sua velocità in
simili azioni. Minutamente si veggono narrati questi fatti da
Cristoforo da Soldo, storico bresciano. Solamente nel mese di giugno
uscì in campagna Francesco Sforza, e passò sul Bresciano in cerca
del Piccinino. Nel dì 25 d'esso mese seguì fra le sue genti e quelle
d'esso Piccinino un incontro assai caldo, colla peggio degli
Sforzeschi; e da lì innanzi andarono poi girando e come giocando le
armate, senza volontà di provar la loro fortuna. Il motivo era, perchè
si trattava forte di pace in segreto, e il conte Francesco, che
onoratamente comunicava tutte le proposizioni ai commessarii
veneziani, era il principale in questo dibattimento.
Ciò che diede impulso a ripigliarne il trattato, fu l'insolenza de'
capitani del duca di Milano, i quali, mirando esso duca già avanzato
in età, e senza figliuoli maschi, tutti d'accordo pensavano ad
assicurar la loro fortuna con chiedergli qualche porzione dello Stato
di lui. Faceva istanza il Piccinino par avere Piacenza in sua parte;
Lodovico da San Severino per Novara; Lodovico dal Verme per
Tortona; Taliano Furlano dimandava il Bosco e Fragaruolo nel
distretto d'Alessandria. Dispiacque talmente questa sinfonia al duca,
che, chiamato a sè Antonio Guidobuono da Tortona suo uomo fidato,
ed amico ancora del conte Francesco Sforza, segretamente il mandò
a far proposizioni d'accordo ad esso conte, offerendogli la figliuola
Bianca, e la città di Cremona con Pontremoli in dote, e con altre
esibizioni per appagar anche i Veneziani e Fiorentini. Andò tanto
innanzi questa pratica, che, essendo conchiusi i principali articoli
[Sanuto, Istor. di Venezia, tom. 22 Rer. Ital. Cristoforo da Soldo, Istor. Bresc., tom.
21 Rer. Ital.], nel dì primo d'agosto, mentre il conte Francesco
assediava e batteva colle bombarde Martinengo, dove s'erano chiusi
circa mille dei migliori cavalli del Piccinino, all'improvviso saltò fuori
la tregua fra le parti guerreggianti, e cessò quell'assedio. Nel 3
d'esso mese Niccolò Piccinino, che coll'esercito suo era accampato in
que' contorni, con tutti i suoi uffiziali andò a visitare il conte
Francesco. Allora si abbracciarono e baciarono questi due gran
capitani, e il conte, oltre all'onore e alle carezze che fece a tutti quei
condottieri d'armi, perdonò anche a Taliano Furlano, che piagnendo
gli dimandò perdono. Eletto dalle parti arbitro per conchiudere la
suddetta pace, esso conte portossi alla Cauriana sul Mantovano,
dove si raunarono ancora gli ambasciatori del papa, de' Veneziani e
Fiorentini, del duca di Milano, e de' marchesi di Ferrara e di Mantova.
Fra le condizioni accordate dal duca vi fu il matrimonio di Bianca sua
figliuola, in età allora di sedici anni, col conte Francesco; e però
prima di pubblicar la pace andò egli nel dì 25 d'ottobre [Chron. Placent.,
tom. 20 Rer. Ital. Cronica di Rimini, tom. 15 Rer. Ital.] (il Simonetta [Simonetta,
Vit. Francisci Sfortiae, tom. 21 Rer. Ital.] dice il dì 24) con due mila cavalli
presso a Cremona; e giunta colà anche Bianca con gran compagnia,
la sposò in San Sigismondo, e prese il possesso di Cremona; per le
quali nozze si fece mirabil festa in quella città con bagordi, giostre ed
altre allegrie [Annales Forolivienses, tom. 22 Rer. Ital. Platina, Istor. di Mantova,
lib. 5.]. Fu poi nel dì 20 di novembre pubblicata la pace, in cui Gian-
Francesco marchese di Mantova, secondo la disgrazia de' più debili
nelle leghe, lasciò il pelo, avendo dovuto restituire a' Veneziani Porto,
Legnago, Nogarola, ed altri luoghi da lui presi, e rimettervi del
proprio Valeggio, Asola, Lunato e Peschiera, a lui tolti da' Veneziani.
Grande allegrezza fu quella di tutta Lombardia per questa pace.
Mutazione accadde nell'anno presente in Ravenna [Rubeus, Hist.
Ravenn., lib. 7. Cronica di Ferrara, tom. 24 Rer. Ital.]. Vi era signore Ostasio
da Polenta, che col suo governo parea andare a caccia delle maniere
di farsi odiare da' sudditi suoi. Se l'intesero questi col senato veneto,
il quale chiamò a Venezia esso Ostasio colla moglie e col figliuolo,
mostrando di voler far loro grande onore. Venne egli a Ferrara, e
quantunque il marchese Niccolò il consigliasse di non andare, volle
proseguire il suo viaggio. Giunto ch'egli fu colà, il popolo di Ravenna,
dato di piglio all'armi nel dì 24 di febbraio, si suggettò a' Veneziani,
che presero il dominio e possesso di quella città. Ostasio fu inviato in
Candia, dove trovò non men egli che il figliuolo la morte col tempo:
con che in esso mancò la nobil famiglia, o almen la signoria de'
Polentani, che da lungo tempo dominarono in Ravenna. A papa
Eugenio dispiacque non poco di veder passare quella sua città in
mani sì potenti. Talmente s'era in questi tempi affezionato il duca di
Milano a Niccolò Estense marchese di Ferrara, principe di sommo
credito, che, chiamatolo a Milano, non solo si cominciò a reggere col
suo consiglio, ma in certa guisa depositò in lui il governo de' suoi
Stati. Corse anche voce che meditasse di farlo suo successore dopo
la sua morte. Tanta parzialità del duca gli tirò tosto addosso l'invidia
di chi era solito a comandare in quella corte, e di chi già pensava a
veder succedere in quel ducato il conte Francesco Sforza. Cadde egli
infermo nel dì 26 di dicembre, e in poche ore, con fama di veleno a
lui dato, si sbrigò da questo mondo, con essere poi portato a Ferrara
il cadavere suo, e datagli sepoltura nel dì primo dei seguente
gennaio. Lionello suo figliuolo bastardo, ancorchè vi fossero Ercole e
Sigismondo suoi figliuoli legittimi, a lui nati da Ricciarda figlia del
marchese di Saluzzo, ma allora piccioli di età, per disposizione del
padre e del papa, succedette nei dominio di Ferrara, Modena,
Reggio, Rovigo e Comacchio. Fu anche guerra in quest'anno [Cronica
di Rimini, tom. 20 Rer. Ital.] fra Sigismondo Pandolfo de' Malatesti signore
di Rimini e il conte d'Urbino; ma per opera di Alessandro Sforza,
fratello del conte Francesco, seguì pace fra loro. E nel mese di
agosto i Sanesi [Chronic. Senense, tom. eod.] ebbero gravi molestie da
Simonetta capitano di papa Eugenio; ma in fine lo sconfissero, e il
fecero fuggire ferito alla di lui patria. I Veneziani dopo la pace
cassarono gran copia delle lor soldatesche; e il bello fu, che quante
ne potè tirar dalla sua il Piccinino, tutte le prese al suo soldo, ossia a
quello del duca di Milano.
Anno di
Cristo mccccxlii. Indizione v.
Eugenio IV papa 12.
Federigo III re de' Romani 3.
Già si godeva buona quiete in Lombardia, e la guerra tutta s'era
ridotta nel regno di Napoli, dove la capitale, stretta d'assedio da
Alfonso re d'Aragona, era valorosamente, ma con gran disagio,
difesa dal re Renato d'Angiò e dai Napoletani, che molto lo amavano
[Simonetta, Vit. Francisci Sfortiae, lib. 6, tom. 21 Rer. Ital.]. Essendo
nulladimeno in grave tracollo gli affari di esso Renato, questi nel
verno non lasciò addietro preghiere e promesse al conte Francesco
Sforza per condurlo nel regno alla propria difesa. E non trovò in
questo molte difficoltà, perchè il conte era amareggiato forte a
cagion dell'occupazione delle sue città già fatta dal re Alfonso nel
regno. Misesi dunque in punto colle maggiori forze ch'egli potò
raunare ed assoldare nei mesi del freddo, ed ebbe fra gli altri unito
a' suoi disegni Sigismondo Pandolfo Malatesta signor di Rimini, e
genero suo per cagione di Polissena sua figliuola con lui maritala in
quest'anno. Mandato innanzi Giovanni suo fratello con parte
dell'esercito, gli diede ordine d'unirsi nel regno di Napoli con Antonio
Caldora, il quale già s'era partito dalla divozione del re Alfonso.
Poscia il conte nel principio di maggio [Sanuto, Istor. Ven., tom. 22 Rer.
Ital.] imprese il viaggio anche egli a quella volta col rimanente
dell'esercito. Ma mentre egli rivolgea i suoi passi e disegni contra
d'un lontano nemico, con bene strana scena trovò di averne un altro
assai vicino, a cui non avrebbe mai pensato. Per quanto attesta il
Simonetta, dacchè il re Alfonso conobbe i preparamenti dello Sforza
contra di lui, si diede a tempestar con calde lettere Filippo Maria
duca di Milano, acciocchè ritenesse il conte da quella spedizione. Da
questo ancora si può scorgere che irregolar testa fosse quella del
duca. Non erano, per così dire, quattro giorni che egli nel valoroso
conte si era fatto un genero, e come un figliuolo; eppure non tardò
ad operar contra di lui alla peggio, sia perchè gli dispiacesse di
vederlo tuttavia protetto da' Veneziani e Fiorentini, ed unito con loro,
ovvero che si fosse pentito di un accasamento fatto quasi per forza e
suo malgrado. Però questo sì instabile principe suscitò contra del
conte papa Eugenio, con rappresentargli d'essere venuto il tempo di
ricuperar la Marca, e con offerirgli anche le sue forze sotto il
comando del Piccinino. Infatti, fingendo egli di aver licenziato dal suo
servigio Niccolò Piccinino, questi nel dì 3 di marzo arrivò con molta
gente d'armi a Bologna [Cronica di Bologna, tom. 18 Rer. Ital.], città a lui
sottoposta, facendo vista d'andarsene a Perugia patria sua. Fu egli
poi dichiarato gonfaloniere della Chiesa romana da papa Eugenio
[Bonincontrus, Annal., tom. 21 Rer. Italic.]; e giunto a Todi, posseduta allora
dal conte Francesco, con un trattato se ne impadronì. Questa novità
fece fermare il conte nella Marca, per accudire ai proprii interessi, e
prese con Bianca sua moglie per sua residenza Jesi.
Mentre queste cose succedeano, Alfonso re d'Aragona, principe di
gran mente e sagacità, e di non minore fortuna, continuava l'assedio
della città di Napoli, con averla ridotta a gran penuria di vettovaglie
[Giornal. Napol., tom. 22 Rer. Ital. Istor. Napoletana, tom. 23 Rer. Ital. Sanuto,
Istor. Ven., tom. 22 Rer. Ital.]. Da due mastri muratori napoletani, che
furono presi, gli fu insegnata la maniera d'entrare in Napoli, cioè per
quello stesso acquedotto per cui tanti secoli prima Belisario s'era
nella città medesima introdotto. Era esso strettissimo; il re Renato vi
avea fatto mettere dei cancelli di ferro ed altri ripari, e fattavi fare la
guardia; ma non fu continuata quest'ultima cautela. Perciò nel
venerdì notte, vegnendo il sabbato, dì 2 di giugno, per quel condotto
sotterraneo il re Alfonso spinse, chi dice quaranta, e chi più
verisimilmente trecento o quattrocento de' suoi soldati entro la città;
e questi fino all'apparir del giorno si tennero nascosi in una casa.
Fatto giorno, ordinò il re che si desse un fiero assalto alle mura di
Napoli alla parte opposta: nel qual tempo i soldati entrati,
impossessatisi d'una porta, v'inalberarono la bandiera aragonese.
Nello stesso tempo que' di fuori cominciarono colle scale a salir su
per le mura; e quantunque il re Renato come un lione accorresse e
facesse molte prodezze per trattenere questo torrente, pure fu in
fine forzato a ritirarsi, per timore d'essere preso, in Castello Nuovo.
Entrati dunque gli Aragonesi, per quattro ore diedero il sacco alla
città, finchè arrivato anche Alfonso, mandò bando, pena la vita, che
desistessero dalle offese. Grandi carezze fece ai Napoletani, e la città
s'empiè in breve di vettovaglia. Giunsero in quel tempo due navi
genovesi [Bonincontrus, Annal., tom. 21 Rer. Ital.], che misero provvisioni
in Castello Nuovo; e sopra d'esse imbarcatosi il re Renato, se n'andò
a Firenze a raccontar le sue disavventure al papa, e a lamentarsi di
lui, perchè avesse impedito al conte Francesco il recargli aiuto. Fu
consolato con una bella investitura del regno di Napoli, che
veramente venne a tempo al suo bisogno; e però se ne tornò da lì a
qualche tempo in Provenza, assai chiarito della volubilità delle cose
umane. Seppe ben prevalersi della sua fortuna il re Alfonso. Da lì a
pochi giorni si rendè il castello di Capuana, e il Nuovo fu assediato.
Nel dì 21 di giugno marciò coll'esercito suo contro ad Antonio
Caldora, il quale nel dì 28, unito con Giovanni Sforza fratello del
conte, animosamente andò ad attaccar battaglia col re. Se non era
esso Caldora tradito da' suoi, forse gli dava una mala giornata; ma
restò sbaragliato e preso. Secondo il Simonetta [Simonetta, Vit. Francisci
Sfortiae, lib. 6, tom. 21 Rer. Ital.], grave sospetto di tradimento diede il
medesimo Antonio. Poscia perchè egli rivelò al re le intelligenze di
molti signori del regno col conte Francesco, ebbe salva la vita, e con
quattro bicocche a lui concedute in Abbruzzo fu rimesso in libertà,
essendo passate le sue genti al servigio di Alfonso. Giovanni Sforza,
venuto colà con due mila cavalli, se ne tornò con soli quindici a
trovare il conte suo fratello nella Marca. Non finì l'anno che, a riserva
di Tropea e di Reggio di Calabria, tutto il regno venne alla divozione
del re Alfonso, principe liberale verso gli amici, clemente verso i
nemici, e che facea buona giustizia ad ognuno. Ebbe anche le due
fortezze di Castello Nuovo e castello Sant'Ermo, de' quali il re Renato
volle piuttosto fare mercato con Alfonso, che difenderli senza frutto
alcuno.
Il papa, stato in addietro sì saldo contra del re Alfonso, dacchè il
vide cotanto esaltato, cominciò ad addolcirsi con lui, e forse fin
d'allora si diede ad intavolar seco un segreto trattato per abbattere il
conte Francesco Sforza, e spogliarlo della marca d'Ancona [Raynaldus,
Annal. Eccles.]. Non si ricordava egli più dei servigi a lui prestati da
questo insigne capitano di guerra, nè delle investiture a lui date, e
confermate nell'anno presente, non credendosi tenuto ad osservar
patti stabiliti in danno della Chiesa romana, dovendo valer solamente
ciò che le è di utile. Trovò che il conte avea prese alcune terre della
stessa Chiesa non comprese nella sua investitura. Era anche mal
soddisfatto di lui, e con ragione, se è vero ciò che porta Neri Capponi
[Neri Capponi, Comment., tom. 18 Rer. Ital.]; perchè nella pace non gli avea
fatto immediatamente restituir Bologna, detenuta dal Piccinino,
benchè ciò si dovesse effettuar solamente due anni appresso. Ed
intanto il Piccinino non era tenuto reo, anzi era a' servigi del
medesimo papa. Per attestato del Poggio [Poggius, Hist., lib. 6.], avea
fatto lo Sforza il suo dovere per fargli restituire Bologna, ma il duca
non volle. Pubblicò dunque il papa sul principio di agosto una bolla
contra di Francesco Sforza, dichiarandolo privato del grado di
gonfalonier della Chiesa, ribello e nemico. Dispiacque ciò forte ai
Fiorentini e Veneziani, che proteggevano il conte, e i primi diedero
anche ordine a Bernardo de Medici di metter pace fra esso conte e il
Piccinino [Ammirati, Istor. Fiorent., lib. 22.]: il che si effettuò, con essersi
veduti insieme ed abbracciati di nuovo questi due valorosi guerrieri.
Ma che? non passò molto che il Piccinino occupò al conte la terra
ossia città di Tolentino, e tornò alle ostilità. Il Medici di nuovo
s'interpose, e racconciò gli affari; ma per poco tempo, perchè
appena lo Sforza si fu mosso per passare nel regno contra del re
Alfonso, con dare un fiero sacco a Ripa Transona, che il Piccinino alle
istanze dei legati del papa gli tolse Gualdo, ed imprese dipoi l'assedio
della città d'Assisi. Alla difesa vi fu inviato dal conte con della fanteria
Alessandro Sforza suo fratello, ma indarno [Blondus, Dec. IV, lib. 1.].
L'avventura o disavventura stessa che dianzi provò Napoli, tornò a
vedersi sotto Assisi. Cioè per un acquedotto, insegnatogli da un
frate, il Piccinino una notte introdusse entro quella città un migliaio
di fanti, colle spalle de' quali anche il resto delle sue genti v'entrò nel
dì 30 di novembre [Annal. Foroliviens., tom. 22 Rer. Ital.]. Fu posta a sacco
tutta l'infelice città, nè si lasciò indietro iniquità che non fosse
commessa, senza neppure portare rispetto alcuno al venerabil
tempio di San Francesco. Gran discredito venne a Niccolò Piccinino
per questa barbarie, aggiunta all'aver due volte rotti i patti e
giuramenti della pace fatta col conte. Ne' medesimi tempi il re
Alfonso finì di prendere tutte le terre spettanti nel regno ad esso
conte, e furono, secondo l'asserzione del Simonetta [Simonetta, Vit.
Francisci Sfortiae, tom. 21 Rer. Ital.], Ariano, Manfredonia, Troia e Monte
Sant'Angelo. Mandò bensì il conte Francesco uno de' suoi primi
uffiziali, cioè Troilo, al re, per trattar d'accordo; ma Alfonso l'andò
menando a spasso con belle parole, senza mai voler conchiudere
cosa alcuna; anzi indusse con vantaggiose promesse Troilo stesso ad
abbandonare il servigio del conte: il che, siccome vedremo, fu
eseguito a suo tempo. Intanto, se crediamo al Sanuto [Sanuto, Istor.
Venet., tom. 22 Rer. Ital.], nel dì 16 d'ottobre fu conchiusa una lega fra
esso re Alfonso, il duca di Milano e Niccolò Piccinino contro la lega
de' Veneziani, Fiorentini e conte Francesco. Fin qui avea Tommaso
da Campofregoso doge di Genova lodevolmente governata quella
città [Giustiniani, Istoria di Genova, lib. 5.]; ma essendo mancato di vita in
quest'anno Batista suo fratello, ch'era il suo principale appoggio, ed
avendo i Genovesi per loro nemici il re Alfonso e il duca di Milano, si
manipolò una congiura contra di questo doge. Gian Antonio del
Fiesco, che n'era il capo, entrò nella città con una frotta d'armati
nella notte precedente al dì 18 di dicembre, e mosse a rumore il
popolo. Fatto giorno, perchè Tommaso non si sentiva voglia di
cedere, fu dato l'assalto al palazzo ducale, in maniera ch'esso doge
si rifugiò nella torre dello Orologio, e si diede poscia a Raffaello
Adorno. Furono creati gli anziani e capitani del popolo pel governo
della città, la quale tornò ben tosto alla quiete primiera.
Anno di
Cristo mccccxliii. Indiz. vi.
Eugenio IV papa 13.
Federigo III re de' Romani 4.
Perchè papa Eugenio avea trasferito a Roma il concilio, ed inoltre
perchè colla fervente voglia di riacquistare la marca d'Ancona,
conoscea che non potea andare d'accordo co' Fiorentini, impegnati
in favore del conte Francesco Sforza, determinò di lasciar Firenze per
passare a Roma [Hist. Senensis, tom. 20 Rer. Ital.]. Misesi dunque in
viaggio nel dì 7 di marzo, e giunse nel dì seguente a Siena, dove
immensi onori ricevette da quel popolo. Fermossi in quella città sino
al dì 5 di settembre, nel qual tempo venne a tributargli il suo
ossequio Niccolò Piccinino gonfaloniere della Chiesa, a cui fu fatto un
magnifico incontro. Stando quivi Eugenio, cominciò (seppure non
avea cominciato molto prima) a tener pratica di pace e di lega col re
Alfonso, per valersi del braccio di lui a cacciar dalla Marca Francesco
Sforza. Era Alfonso esperto trafficante ne' suoi politici affari. Nel
medesimo tempo avea tenuto trattato col conte Francesco e col
Piccinino suo avversario, e finalmente conchiuse con chi più
vantaggio gli promettea, cioè col Piccinino. Similmente, nel mentre
che maneggiava concordia con papa Eugenio, facea di grandi
esibizioni all'antipapa Felice, ossia ad Amedeo, e al concilio di
Costanza, affin di ottenere l'investitura del regno di Napoli per sè e
per don Ferdinando suo figliuol bastardo, già dichiarato duca di
Calabria. Molto ancora a lui prometteva sì di privilegii come di danaro
il suddetto Amedeo. Così facea finezze e paura nello stesso tempo
non meno al papa che all'antipapa. Finalmente il pontefice Eugenio,
dopo aver fatto il ritroso un pezzo, si acconciò con Alfonso, e gli
accordò tutto quanto egli seppe dimandare, purchè egli impiegasse
le forze sue per liberar la Marca dalle mani del conte Francesco. Nel
dì 14 di giugno da Lodovico patriarca d'Aquileia e cardinale furono
sottoscritti a nome del papa gli articoli di quella concordia, rapportati
con altri atti dal Rinaldi [Raynaldus, Annal. Eccles.]. Partito poi da Siena il
papa, arrivò felicemente a Roma nel dì 28 di settembre [Petroni, Hist.,
tom. 24 Rer. Ital.], e nel dì 13 di ottobre diede principio nel Laterano al
concilio. Guidantonio conte di Montefeltro e d'Urbino venne a morte
nell'anno presente nel dì 21 di febbraio, e gli succedette, secondo la
Cronica di Ferrara [Cronica di Ferrara, tom. eod.], nel dominio il conte
Antonio suo figliuolo, oppure, secondo gli Annali di Forlì [Annales
Foroliviens., tom. 22 Rer. Ital.], Taddeo parimente chiamato suo figlio.
Oddo Antonio egli è appellato, e credo con più fondamento,
dall'Ammirati [Ammirati, Istor. di Firenze, lib. 22.] e da altri. Grande novità
succedette quest'anno in Bologna [Cronica di Bologna, tom. 18 Rer. Ital.].
Nel precedente era venuto in quella città Francesco Piccinino per
governarla a nome di Niccolò suo padre. Essendo infermo, si fece
portare a castello San Giovanni, ed accompagnare da Annibale
Bentivoglio e da Gasparo ed Achille dei Malvezzi. Giunto là, fece
prendere questi tre nobili bolognesi, e mandò Annibale nella rocca di
Varano su quel di Parma, Achille nella rocca di Mompiano sul
Genovesato, e Gasparo nella rocca di Pellegrino nel Piacentino. Per
quante premure facessero i Bolognesi presso il duca di Milano e
presso Niccolò Piccinino per la liberazione di questi loro concittadini,
altro non ne riportarono che belle parole e promesse. Si mossero
perciò segretamente da Bologna due valorosi giovani, cioè Galeazzo
e Taddeo de' Marescotti con tre altri amici d'Annibale Bentivoglio per
cercare le vie di liberarlo. Giunti alla rocca di Varano, ebbero tal
industria e fortuna, che una notte scalarono il muro, e misero le
mani addosso al castellano e al suo famiglio; sicchè, entrati nella
prigione, e limati i ceppi di Annibale, poterono poi nella notte
seguente fuggirsene, menando seco il castellano, finchè furono in
salvo. Vennero a Spilamberto sul Modenese, dove dal conte
Gherardo Rangone ebbero consiglio ed aiuto; e, mandato innanzi
l'avviso della lor venuta nel dì 5 di giugno [Sanuto, Ist. Ven., tom. 22 Rer.
Ital.], nella seguente notte furono dai loro amici tirati su per le mura
con delle corde. Poscia senza perdere tempo, raunati i lor partigiani,
e facendo sonare campana a martello a San Giacomo, col popolo in
armi corsero furiosamente al palazzo del pubblico, dove abitava
Francesco Piccinino, che indarno fece resistenza colle sue genti
d'armi. Entrarono nel palazzo, vi fu preso il medesimo Piccinino colla
sua brigata; e diedesi subito principio all'assedio del castello di
Galiera, che teneva in freno la città.
Accadde che in quel tempo passava il conte Lodovico del Verme
pel Bolognese, incamminato alla volta della Marca con molta gente a
cavallo e a piedi, per unirsi a Niccolò Piccinino. Per questa novità egli
si fermò, ed unito con Guidantonio de' Manfredi signor di Faenza,
tenne saldo, e presidiò molte castella del Bolognese, e cominciò
guerra colla città. Non tardarono i Bolognesi a spedir messi a
Venezia e Firenze per soccorso, e nel dì 6 di luglio fecero lega con
quelle due repubbliche. In loro aiuto furono spediti da Venezia il
conte Tiberto Brandolino da Forlì e il conte Guido Rangone da
Modena, valenti capitani di questi tempi, con mille cavalli e ducento
fanti. Anche i Fiorentini v'inviarono Simonetto da Castello di Piero
con ottocento cavalli e ducento pedoni. Nel dì 14 d'agosto venuto a
Bologna l'avviso che il conte Lodovico del Verme s'era levato dalla
Riccardina per passare alla Pieve e a San Giovanni con tre mila
cavalli; Annibale de' Bentivogli, messi in armi i Bolognesi, andò a
trovarlo a Ponte Polledrano, e con tal furia l'assalì, che, dopo breve
combattimento, il mise in rotta. Vi rimasero presi da due mila cavalli,
undici capi di squadra e tutto il carriaggio. La miglior arma che
adoperarono il Verme e gli altri capitani furono gli speroni. Per
questa importante vittoria tornarono alla divozion di Bologna tutte le
terre e castella di quel distretto; e nel dì 21 si rendè la cittadella di
Galiera, a spianar la quale immediatamente si accinse il popolo. Fu
cambiato Francesco Piccinino con Gasparo ed Achille Malvezzi
condotti dalle rocche dove erano prigioni. Così tornò in sua libertà la
città di Bologna. Grandi poi furono in questo anno le applicazioni del
papa e del re Alfonso per togliere la marca d'Ancona al conte
Francesco [Giornal. Napolet., tom. 21 Rer. Ital.]. Era già entrato esso re in
Napoli su carro trionfale nel dì 26 di febbraio, precedendo tutta la
fiorita nobiltà di quel regno. Andato da lì a qualche tempo Niccolò
Piccinino a Terracina, oppure a Gaeta, a trovarlo, fu ricevuto con
gran distinzione, ed onorato col cognome della casa d'Aragona (avea
già quello della casa de' Visconti), e con lui concertò l'impresa della
Marca. Aveva il conte Francesco presa e saccheggiata Santa Natolia
nel territorio di Camerino, e ricuperato Tolentino; ed allorchè s'avvide
del nembo che gli soprastava dalla parte del re d'Aragona e di
Napoli, cominciò a sollecitare gli aiuti de' Veneziani e Fiorentini, che
tardarono di troppo. Intanto il re, fatta da tutte le parti gran massa
di gente d'armi, venne nel mese d'agosto in persona verso Norcia,
ed andò ad unirsi con Niccolò Piccinino, il quale, assediando la terra
di Visso nell'Umbria, la costrinse alla resa. Se vogliamo prestar fede
agli Annali di Forlì [Annal. Foroliv., tom. 22 Rer. Ital.], ascendeva l'armata
del re e del Piccinino a trenta mila tra cavalli e fanti. Forze da
resistere a sì grosso torrente non avea il conte Francesco [Simonetta,
Vit. Francisci Sfortiae, lib. 6, tom. 21 Rer. Ital.]; però, poste buone
guarnigioni nelle piazze più importanti (cioè Alessandro suo fratello
in Fermo, Giovanni altro suo fratello in Ascoli, Rinaldo Fogliano suo
fratello uterino in Cività, Pietro Brunoro in Fabriano, Fioravante da
Perugia in Cingoli, Giovanni da Tolentino suo genero in Osimo, Troilo
da Rossano in Jesi, e Roberto da San Severino in Rocca Contrada), si
ritirò egli con parte del suo esercito a Fano, città ben forte di
Sigismondo Malatesta suo genero, per quivi aspettare i sospirati
soccorsi de' collegati, coi quali potesse far fronte, occorrendo ai
nemici.
Ma volle la sua disavventura che, oltre a Manno Barile, il quale
sul principio di quest'anno l'avea abbandonato, anche altri suoi
principali condottieri di armi in sì grave congiuntura il tradissero.
Entrato dunque Alfonso col Piccinino nella Marca, ed inalberate le
bandiere della Chiesa, tosto si volsero alla di lui ubbidienza San
Severino, Matelica, Tolentino e Macerata. Pietro Brunoro gli diede
Fabriano, ed acconciossi con lui [Sanuto, Istor. Venet., tom. 22 Rer. Ital.].
Altrettanto fece Troilo, benchè cognato del conte Francesco, dandogli
Jesi, e passando al suo servigio colle sue truppe. Con ciò vennero
meno al conte Francesco più di due mila dei suoi cavalli, e molte
schiere di fanteria, che andarono ad ingrossar maggiormente
l'esercito nemico. Poscia anche Cingoli si rendè ad Alfonso, e il
popolo d'Osimo, levato a rumore, ebbe forza di spogliare Giovanni da
Tolentino ed Antonio Trivulzio col presidio [Cronica di Rimini, tom. 15 Rer.
Ital.]. Toscanella ed Acquapendente alzarono anch'esse le insegne
della Chiesa. In somma non passò gran tempo che tutta la Marca, a
riserva di Fermo, d'Ascoli e di Rocca Contrada, venne in potere del re
e del Piccinino, che ne prese il possesso a nome del papa. Sbrigato
dalla Marca il re Alfonso, nel dì 12 di settembre venne a mettere il
campo alla città di Fano, dove si trovava il conte Francesco con gran
gente; ma, conosciuto che poco onore potea guadagnare sotto sì
forte città, nel dì 18 se ne tornò indietro, e portò le sue armi contro
quella di Fermo, alla cui difesa si trovava Alessandro Sforza con buon
presidio. Fu in questa occasione che rimasero puniti dei lor
tradimenti Pietro Brunoro e Troilo cognato del conte Francesco
[Giornal. Napolet., tom. 22 Rer. Ital.]. Furono intercette, cioè fatte cadere
in mano del re, lettere scritte loro da esso Alessandro con ordine
d'eseguire quanto era stato ordinato. Confessa il Simonetta
[Simonetta, Vit. Francisci Sfortiae, lib. 6, tom. 21 Rer. Ital.], essere stato
questo uno stratagemma del medesimo conte Francesco, che scrisse
al fratello di così operare, per mettere in diffidenza presso il re que'
due condottieri, dai quali egli era stato tradito. E ne seguì l'effetto.
Fu dunque costantemente creduto che costoro con intelligenza del
conte fossero passati nella regale armata, per poi assassinare il re. E
perciò il re, messe in armi le sue truppe, li fece prendere amendue, e
legati gl'inviò a Napoli, e di là li mandò in una fortezza del regno di
Valenza, dove stettero per dieci anni. Secondo il Simonetta, furono
anche spogliate tutte le genti d'armi dei suddetti due; ma l'autore de'
Giornali Napoletani vuole che il re le prendesse tutte al suo soldo. Nè
è da tacere una curiosa particolarità, di cui non io, ma Cristoforo da
Costa negli Elogii delle donne illustri sarà mallevadore. Cioè che
Pietro Brunoro da Parma, trovata una fanciulla, per nome Bona,
nativa della Valtellina, di spirito non ordinario, seco la conduceva
vestita da uomo, con avvezzarla al mestier della guerra. Dappoichè
Brunoro fu messo prigione, ella andò a tutti i principi d'Italia e di
Francia, e ne portò lettere di raccomandazione al re Alfonso per la
liberazione di questo suo padrone, di maniera che egli uscì dalle
carceri. Gli procurò essa in oltre una condotta di milizie dai Veneziani
coll'assegno annuo di venti mila ducati; per li quali benefizii egli poi
la sposò. Militò ella finalmente col marito, fece di molte prodezze, e
con esso fu inviata contro i Turchi alla difesa di Negroponte. Quivi
terminò i suoi giorni Brunoro, ed ella, tornando in Italia nel 1466, per
viaggio ammalatasi, diede fine alla sua vita. Dopo avere il re Alfonso
tentato invano Ascoli, e preso Teramo e Civitella con altri luoghi,
ch'erano del conte Francesco, menò a quartiere le sue soldatesche
nel regno di Napoli.
Era intanto restato tra Pesaro e Rimini Niccolò Piccinino insieme
con Federigo conte d'Urbino, e con Malatesta signor di Cesena, e
facea guerra or qua or là alle terre di Rimini, con ridursi in fine a
Monteloro. Intanto in soccorso del conte Francesco arrivarono il
conte Guido Rangone, Simonetto, Taddeo marchese di Este ed altri
capitani con cavalleria e fanteria, spediti da' Veneziani e Fiorentini.
Con sì fatti rinforzi il valoroso conte, menando seco Sigismondo
Malatesta signore di Rimini e genero suo (della cui fede si dubitò non
poco, allorchè il re Alfonso fu sotto a Fano), andò nel dì 8 di
novembre insieme con Alessandro suo fratello e con gli altri capitani
a trovare il Piccinino, e fu con lui alle mani, ancorchè il vedesse
postato in un sito assai difficile e vantaggioso. Per molte ore durò
l'atroce battaglia; e quantunque il Piccinino facesse delle maraviglie,
più ne fece il conte Francesco, con dargli una gran rotta, prendere
circa due mila cavalli, e tutto il ricchissimo bagaglio de' nemici. Col
favor della notte si salvò con pochi esso Piccinino a Monte Ficardo,
pieno di confusione e di dolore. Spese poi il conte qualche tempo,
per le importune istanze di Sigismondo Malatesta, intorno a Pesaro,
signoreggiato allora da Galeazzo Malatesta. Di là passò nella Marca,
dove trovò che il Piccinino avea rinforzato di gente le principali città;
e però, dopo aver ridotte alla sua divozione alcune poche castella, se
n'andò a Fermo, e quivi svernò con parte delle sue milizie. Or mentre
queste cose succedeano, e dacchè vide Filippo Maria duca di Milano
che gli affari del genero suo, cioè del conte Francesco, andavano alla
peggio nella Marca, siccome principe non mai fermo ne' suoi
proponimenti, cominciò a pentirsi delle sregolate o balorde sue
risoluzioni, e a desiderare ch'egli non perdesse il suo Stato. Perciò
nel dì 8 di settembre spedì suoi ambasciatori a Venezia [Sanuto, Istor.
Venet., tom. 22 Rer. Ital.] per collegarsi con quella repubblica e co'
Fiorentini in favore del conte, e fece anche sapere al re Alfonso di
desistere dall'offenderlo. Si maravigliò forte il re di questa
inaspettata mutazion di volere del duca; inviò a lui ed anche a
Venezia ambasciatori; ma niuna grata risposta ne ricevette.
Servirono questi passi del duca, e il trattato di lega fra lui, Venezia e
Firenze, a fare [Annal. Foroliviens., tom. eod.] ch'egli poi si ritirasse da
Fano, e se ne tornasse nelle sue contrade. Ed intanto nel dì 24 di
settembre fu conchiusa la lega suddetta in Venezia, in cui ancora
entrò Sigismondo Malatesta signore di Rimini. Elessero in quest'anno
a dì 28 di gennaio [Giustiniani, Istor. di Genova, lib. 5.] i Genovesi
pacificamente per loro doge Raffaello Adorno, di famiglia altre volte
salita a quella dignità.
Anno di
Cristo mccccxliv. Indiz. vii.
Eugenio IV papa 14.
Federigo III re de' Romani 5.
Trovandosi in Fermo Bianca Visconte moglie del conte Francesco
Sforza, quivi nel dì 24 di gennaio diede alla luce un figliuolo
[Simonetta, Vit. Francisci Sfortiae, lib. 6, tom. 21 Rer. Italic.]; del qual parto fu
immantenente spedita la nuova al duca di Milano, padre di lei, per
sapere qual nome si dovesse porre al nato figliuolo. Gli fu posto
quello di Galeazzo Maria. Fra le sue disavventure ebbe almeno il
conte Francesco questa consolazione. Ma, trovandosi senza danari,
spedì per ottenerne Sigismondo Malatesta suo genero a Venezia, e
ne ricavò questi buona somma, e la maggior parte ancora ne ritenne
per sè a conto delle sue paghe. All'incontro Niccolò Piccinino fu ben
rinforzato di gente e danaro dal papa e dal re Alfonso; laonde entrò
in campagna per tempo, e cominciò le scorrerie pel territorio di
Fermo. Dall'altra parte anche le milizie del re Alfonso ricominciarono
la guerra. A Monte Milone si portò il Piccinino, ed, avendo passato il
fiume Potenza, fu quivi colto da Ciarpellione, uno de' più valenti
condottieri d'armi che si avesse il conte Francesco, e ne riportò una
buona pelata colla prigionia di molti de' suoi. Si salvò egli
miracolosamente, ritirandosi in una torricella, che rimase intatta, per
non avervi fatto mente Ciarpellione. Perchè poi gli venne ordine dal
duca di portarsi a Milano, e di fare intanto tregua col conte
Francesco, eseguì Niccolò il primo comandamento, ma non già il
secondo, avendoglielo impedito il legato del papa. Però, lasciato il
comando dell'armata a Francesco Piccinino suo figliuolo, volò in
Lombardia. Trovossi intanto il conte Francesco in gravi angustie,
perchè Sigismondo Malatesta l'avea tradito con essersi messo in
viaggio colle sue truppe, per andare ad unirsi con lui, ma con aver
poi trovati de' pretesti per tornarsene a Rimini. Dall'altro canto, se
Francesco Piccinino univa la sua armata coll'aragonese, non vedea
modo da poter sostenere la città di Fermo contra di tante forze. Ora
per impedir siffatta unione con quella gente che avea, prese lo
spediente di andare a visitar esso Francesco Piccinino, che s'era ben
postato a Monte Olmo. Secondo il Simonetta, era il dì di venerdì 23
d'agosto, quando gli fu a fronte, e colle schiere in battaglia l'assalì.
Ma non battono i conti secondo il calendario. Negli Annali di Forlì è
scritto che fu il dì 19 d'esso mese [Annal. Foroliviens., tom. 22 Rer. Ital.], e
lo stesso vien confermato dalla Cronica di Rimini [Cronica di Rimini, tom.
15 Rer. Ital.], e dal Sanuto [Sanuto, Istor. Ven., tom. 22 Rer. Ital.], che per
errore dice di maggio. Nè di ciò si può dubitare, stante una lettera
scritta nel medesimo dì 19 d'agosto dal conte Francesco a Bologna,
come s'ha dalla Cronica d'essa città [Cronica di Bologna, tom. 18 Rer. Ital.].
In quel conflitto certo è che segni di gran valore diede Francesco
Piccinino colle sue squadre; ma egli combatteva con un capitano che
in fatti d'armi fu maraviglioso, nè sapea esser vinto. Mentre si
combatteva, Alessandro Sforza occupò le tende e il bagaglio de'
nemici; poscia seguitò ad incalzarli dal suo canto; nel qual tempo il
conte Francesco suo fratello con eguale attenzion ed ardore facea lo
stesso dall'altro. In somma restò sbaragliato l'esercito di Francesco
Piccinino colla perdita di quasi tre mila cavalli, ed egli col rifugiarsi in
una palude cercò di salvarsi, ma da un suo fante tradito fu condotto
prigione al conte Francesco. Ebbero fatica a ridursi in salvo il cardinal
Domenico Capranica legato del papa, e Malatesta a Cesena. Nel dì
seguente Monte Olmo si rendè al conte Francesco, ed ivi fu ritrovata
gran copia d'uffiziali e soldati del Piccinino, che vi si erano rifugiati
con assai cavalli e robe preziose. Ciò fatto, marciò il vittorioso Sforza
a Macerata, e senza fatica se ne impossessò, siccome ancora di San
Severino. Cingoli volle aspettar la forza prima di rendersi, e dopo
otto giorni se gli sottomise con altri piccioli luoghi. Intanto esso
conte fece tentar di pace papa Eugenio, che si trovava allora a
Perugia, conturbato non poco per le di lui vittorie, dopo aver
fulminate le scomuniche nel precedente maggio contra di lui e di
Sigismondo Malatesta. Alle istanze del conte diedero maggior polso
gli ambasciatori di Venezia e Firenze, di maniera che l'accordo seguì
nel dì 10 d'ottobre, con avere il papa lasciate al medesimo conte in
feudo con titolo di marchese tutte le terre da lui possedute e
ricuperate prima del dì 15 oppure 18 del mese suddetto. A riserva
d'Osimo, Recanati, Fabriano ed Ancona, il resto della Marca ubbidiva
ai suoi cenni.
Era venuto a Milano Niccolò Piccinino, chiamatovi, come dissi
(non si sa bene il motivo) dal duca. Non gli si partiva dal cuore
l'affanno per la perdita di Bologna [Corio, Istor. di Milano.], e per la
sconfitta a lui data dal conte Francesco Sforza. A questi pensieri, che
il laceravano di dentro, si aggiunse l'altra dolorosa nuova non solo
della rotta di Francesco suo figliuolo, ma d'esser egli anche caduto
prigione nelle mani dell'emulo ossia nemico Sforza. Soccombè in fine
alla malinconia, ed, infermatosi, terminò il corso del suo vivere nel dì
15 oppure 16 d'ottobre [Cristoforo da Soldo, Istor. Bresc., tom. 21 Rer. Ital.]:
con che mancò uno de' più insigni generali d'armata che s'avesse
l'Italia, a cui niun altro si potea anteporre, se non Francesco Sforza.
Nelle spedizioni la sua attività e prestezza non ebbe pari; ma egli si
prometteva molto della fortuna, e però azzardava bene spesso nelle
sue imprese: laddove lo Sforza sempre operava con saviezza, e
sapea cedere e temporeggiare, quando lo richiedeva il bisogno, nè
temerariamente mai procedeva in ciò che imprendeva. Per la morte
del Piccinino sommamente si afflisse il duca Filippo Maria, rimasto
privo di sì valente, onorato e fedele capitano; nè potendo far altro, si
rivolse a beneficare i di lui figliuoli Francesco e Jacopo, con aver
ottenuta la libertà del primo dal conte Francesco, e con chiamarli
amendue a Milano. Accadde ancora nell'anno presente [Annal.
Foroliviens., tom. 22 Rer. Ital. Cronica di Rimini, tom. 15 Rer. Ital.] la morte di
Oddo-Antonio conte di Montefeltro e d'Urbino, personaggio di
costumi sfrenati e d'insoffribil lussuria. Per cagione di questi suoi vizii
fu egli nella notte del dì 22 di luglio da molti congiurati ucciso, e in
luogo suo proclamato signore Federigo suo fratello, e figliuolo
bastardo di Guidantonio già conte, ancorchè comunemente creduto
fosse figliuolo di Bernardino dalla Carda degli Ubaldini. Questi,
essendo ito a Fermo per visitare il conte Francesco, stabilì tosto con
esso lui lega difensiva ed offensiva. Venne a morte anche in
quest'anno [Cronica di Ferrara, tom. 24 Rer. Ital.], nel dì 8 o pure 24 di
settembre, Gian-Francesco da Gonzaga marchese di Mantova, assai
invecchiato, ed ebbe per successore Lodovico suo figliuolo. Fu
parimente chiamato da Dio a miglior vita nella città dell'Aquila a dì
20 di maggio [Raynaldus, Annal. Eccles.] frate Bernardino da Siena
dell'ordine de' Minori, celebre missionario di questi tempi, che per le
sue luminose virtù venne poi aggregato al ruolo de' santi.
Similmente finì di vivere [Bonincontrus, Annal., tom. 21 Rer. Ital.] Leonardo
Aretino, segretario della repubblica fiorentina, uomo celebre allora
per la sua letteratura e perizia della lingua greca. Si ammalò nel dì 5
d'aprile [Giornal. Napolet., tom. 21 Rer. Ital.] di sì pericolosa malattia
Alfonso re di Aragona e delle Due Sicilie, che corse in fin voce che
era morto. Gran bisbiglio e movimento fu nei baroni del regno, di
modo tale che guarito il re, ben s'avvide del poco capitale che potea
farsi della fede de' regnicoli. Diede egli in questo anno [Istoria Napol.,
tom. 23 Rer. Ital.] per moglie a don Ferdinando duca di Calabria suo
figliuolo Isabella di Chiaramonte, nipote di Gian Antonio Orsino
principe di Taranto. Maritò eziandio Maria sua figliuola col marchese
Lionello d'Este signor di Ferrara, Modena e Reggio. Fu pertanto
spedito Borso d'Este fratello d'esso marchese con due galee
veneziane a levar questa principessa che, accompagnata dal principe
di Salerno, arrivò a Ferrara nel dì 24 d'aprile [Cronica di Ferrara, tom. 24
Rer. Ital.]. Memorabil fu la magnificenza di queste nozze per la
quantità delle feste e dei varii solazzi, che durarono quindici giorni
coll'intervento degli ambasciatori di tutti i principi d'Italia. Fece
guerra in quest'anno il re Alfonso ad Antonio Santiglia signore di
Cotrone, Catanzaro ed altri luoghi in Calabria, e gli tolse tutti quegli
Stati. Condiscese anche a far pace coi Genovesi [Giustiniani, Istor. di
Genova. Sanuto, Istor. Ven., tom. 22 Rer. Ital.], co' quali era in guerra da
gran tempo, e gli obbligò a pagargli ogni anno a titolo di censo un
bacile d'argento, con accordar loro varii privilegii.
HTTP The Definitive Guide 1st Edition David Gourley
Anno di
Cristo mccccxlv. Indiz. viii.
Eugenio IV papa 15.
Federigo III re de' Romani 6.
Fra il duca di Milano e Francesco Sforza suo genero parve nel
precedente anno restituita buona armonia, per quanto abbiamo
veduto. Ma intervenne accidente che affatto la guastò. Dappoichè
mancò, colla morte di Niccolò Piccinino, ad esso duca un raro
generale delle sue armi, mise egli il guardo sopra Ciarpellione, cioè
sopra il più accreditato capitano che si avesse allora Francesco
[Simonetta, Vita Francisci Sfortiae, lib. 6, tom. 21 Rer. Ital.], e segretamente
cominciò a trattare con lui, per torlo al conte e farlo venire a Milano.
Trapelò questo trattato, e se ne crucciò forte il conte, il quale,
fidandosi poco del suocero duca, perchè assai ne conosceva l'umore,
temeva anche dei malanni, se lasciava partire chi era stato partecipe
di tutti i suoi segreti. Fece pertanto mettere prigione nella fortezza di
Fermo Ciarpellione, e processarlo per varie sue iniquità [Cronica di
Rimini, tom. 15 Rer. Ital.]. Dopo di che nel dì 29 di novembre
dell'antecedente anno il fece impiccare, con ispargere voce d'aver
egli macchinato contro la vita del medesimo conte. Altamente si
chiamò offeso per questo fatto il duca, e protestò di volersene
vendicare. Francesco di tutto informò i Veneziani e Fiorentini, a' quali
piacea più di vederlo nemico che amico del suocero. Si partì ancora
dall'amicizia di esso conte Sigismondo Malatesta signore di Rimini,
tuttochè genero del medesimo. Vagheggiava egli da gran tempo
Pesaro e Fossombrone, goduti da Galeazzo Malatesta, cioè da chi era
privo di figliuoli; anzi s'era già provato colla forza, ma indarno,
d'impadronirsene [Sanuto, Istor. Ven., tom. 22 Rer. Ital. Cronica di Ferrara,
tom. 24 Rer. Ital.]. Avvenne che, per interposizione di Federigo conte
d'Urbino, vendè Galeazzo al conte Francesco essa città di Pesaro per
venti mila fiorini d'oro, con che Alessandro Sforza fratello del conte
sposasse Costanza sua nipote, e divenisse padrone di quella città.
Fossombrone eziandio fu venduto al conte Federigo per tredici altri
mila fiorini. Era già per varii motivi mal soddisfatto lo Sforza di
Sigismondo suo genero, uomo anche per altro conto di coscienza
guasta; e però senza alcun riguardo verso di lui fece il suo negozio.
Che disdegno e rabbia per questo provasse Sigismondo, non si può
assai dire. Mosse da lì innanzi cielo e terra contra del conte
Francesco, tanto presso il pontefice, quanto presso il re Alfonso e il
duca di Milano. Spezialmente questo suo sdegno piacque al duca,
per potere valersi di lui contra dello Sforza. Ora Filippo Maria co' suoi
maneggi tanto fece, che papa Eugenio IV prese Sigismondo al suo
soldo, e facendo sperare coll'aiuto proprio e d'esso signore di Rimini
assai facile al papa il riacquistare Bologna, a poco a poco accese il
fuoco d'una nuova guerra. Nè penò molto a tirarvi anche il re
Alfonso, perchè la città di Teramo s'era data al conte Francesco; e
Giosia Acquaviva ed altri del suo regno, ribellatisi a lui, si erano uniti
col medesimo conte. Mentre questi concerti di guerra si andavano
facendo, uno strepitoso accidente avvenne in Bologna [Cronica di
Bologna, tom. 18 Rer. Ital.]. Era in quella città in alta stima Annibale de'
Bentivogli, perchè riguardato come glorioso liberatore della sua
patria. Ma la invidia, nata, per così dire, col mondo, il facea mirar
con occhio bieco da Baldassare da Canedolo, da' Ghiselieri e da
alcuni altri cittadini. Andò tanto innanzi questa cieca passione, che
costoro determinarono di levargli la vita. Fu invitato il Bentivoglio nel
dì 24 di giugno, festa di san Giovanni Batista, da Francesco
Ghiselieri, a tenergli un suo figliuolo al sacro fonte. Finita la funzione,
ed usciti che furono di chiesa, Baldassare e gli altri congiurati,
avventatisi addosso al Bentivoglio, con varie ferite lo stesero morto a
terra [Annales Placentini, tom. 20 Rer. Ital.]. Poscia andarono in traccia
d'alcuni altri amici di lui, e gli uccisero. Per questa enorme indegnità
si levò a rumore tutto il popolo contro i micidiarii; diede il sacco alle
lor case e le bruciò. Batista da Canedolo, benchè non intervenuto a
quell'orrido fatto, indarno fece resistenza all'infuriato popolo, che
trovatolo il tagliò a pezzi [Cronica di Rimini, tom. 15 Rer. Ital.]; e quanti
amici de' Canedoli vennero in mano d'esso popolo, rimasero vittima
del loro furore. Che tal novità fosse fatta con intelligenza del duca di
Milano, si conobbe tosto, perch'egli si dichiarò protettore de'
Canedoli, e nel dì 26 di giugno Taliano Furlano capitano d'esso duca,
che stanziava in Romagna con mille e cinquecento cavalli e
cinquecento fanti ducheschi, entrò tosto nel Bolognese in aiuto de'
Canedoli; ma ritrovatili o morti o sbandati, da lì a poco cominciò la
guerra al Bolognese, e prese varii luoghi. Altrettanto ancora fecero
Luigi da San Severino e Carlo da Gonzaga, altri capitani del
medesimo duca. Ora i Fiorentini, siccome collegati de' Bolognesi, nel
dì 27 di luglio spedirono in loro aiuto Simonetto con cinquecento
cavalli e ducento fanti. Anche i Veneziani inviarono colà Taddeo
marchese d'Este con altra gente. S'ingrossarono intanto sempre più
le milizie del duca di Milano sul Bolognese, e corsero sino alle porte
della città; ma null'altro di considerabile accadde in quelle parti
nell'anno presente, fuorchè la presa di alcuni castelli, fra i quali il più
importante fu San Giovanni in Persiceto, occupato nel dì 9 di
settembre da Luigi da San Severino.
Abbiam veduto poco fa rimesso in grazia di papa Eugenio il conte
Francesco Sforza, e stabilito accordo fra loro. Pure questo pontefice,
quasi che i patti durar dovessero finchè gli tornava a conto il non
romperli, appena si vide animato ed assistito dal duca di Milano, che
ripigliò le armi contra di lui, e seco fu anche il re Alfonso. Ora il conte
[Simonetta, Vit. Francisci Sfortiae, lib. 8, tom. 21 Rer. Ital.], giacchè
Sigismondo signor di Rimini s'era dichiarato nemico suo, dopo avere
ricevuto da' Fiorentini soccorso di danaro, andò a mettere l'assedio
alla ricca terra di Meldola, che gli costò molto tempo e fatica. L'ebbe
a forza di armi nel dì 17 oppure 22 di luglio [Annal. Foroliviens., tom. 22
Rer. Ital.], e col sacco, crudelmente ad essa dato, si arricchirono tutti i
suoi soldati. Ma nel dì 10 d'agosto [Cronica di Rimini, tom. 15 Rer. Ital.] la
città d'Ascoli nella Marca gli si ribellò, e tagliato a pezzi Rinaldo
Fogliano, fratello uterino del conte Francesco, si diede al pontefice.
Così, per le forti istanze di Sigismondo, comparvero dipoi in suo aiuto
Taliano Furlano, Malatesta signor di Cesena ed altri capitani con
ischiere numerose di cavalleria e fanteria, che seco si unirono.
Finalmente anche il papa e il re Alfonso mandarono le lor genti nella
Marca per impadronirsene affatto. In mezzo a questi due fuochi si
trovava il conte, e con forze troppo disuguali. Tuttavia, conoscendo
in maggior pericolo la Marca, lasciata parte delle sue milizie sotto il
comando di Federigo conte d'Urbino, coll'altra marciò colà; e
all'arrivo suo si ritirarono tosto Lodovico patriarca di Aquileia
cardinale legato del papa, e Giovanni da Ventimiglia generale del re
Alfonso. Ed eccoti arrivare in essa Marca anche Taliano, creato
generale dal duca di Milano, con Sigismondo Malatesta, con
Malatesta signor di Cesena ed altri capitani, che cominciò a strignere
dall'una parte lo Sforza, e cercava le vie di unirsi dall'altra alle
soldatesche del papa e del re. Intanto nel dì 15 d'ottobre Rocca
Contrada, una delle migliori fortezze che si avesse il conte in quelle
contrade, ribellatasi, venne in mano di Sigismondo, ossia del
pontefice. Il perchè, peggiorando ogni dì più gl'interessi del conte,
prese questi il partito di salvar la gente con ridursi di nuovo a
Pesaro, dove avea lasciata Bianca Visconte sua moglie.
Raccomandate adunque ad Alessandro suo fratello le città di Fermo
e di Jesi, che restavano a lui ubbidienti, sen venne sul territorio
d'Urbino, da dove col conte Federigo fece guerra a Sigismondo
Malatesta, togliendo a lui alcune castella. Ma nel dì 26 di novembre il
popolo di Fermo, avendo prese l'armi, ne cacciò il presidio del conte,
e si sottomise alle armi del papa; e da lì a qualche tempo si rendè
loro anche la rocca appellata il Girofalco venduta da Alessandro
Sforza, per non poterla sostenere. Sicchè la sola città di Jesi restò in
potere del conte, con essersi perdute tutte le altre terre. Nel dì 12 di
marzo di quest'anno passò all'altra vita [Benvenuto da S. Giorgio, Istor. del
Monferrato, tom. 23 Rer. Ital.] Gian-Giacomo marchese di Monferrato, e i
suoi Stati pervennero al marchese Giovanni suo primogenito. Un
altro suo figliuolo appellato Guglielmo, condottier d'armi in questi
tempi, era al servigio del duca di Milano.
HTTP The Definitive Guide 1st Edition David Gourley
Anno di
Cristo mccccxlvi. Indiz. ix.
Eugenio IV papa 16.
Federigo III re de' Romani 7.
Fulminò di nuovo in quest'anno nei mesi di aprile e di luglio le
scomuniche papa Eugenio contra del conte Francesco Sforza e di
tutti i suoi seguaci [Raynaldus, Annal. Eccl.]. E per vendicarsi de'
Fiorentini, che colla profusione di molto danaro cagione erano che
esso conte non andasse a gambe levate, intavolò un trattato col re
Alfonso per muoverlo contra di loro, siccome poi fece nell'anno
seguente. Intanto il conte era confortato da Cosimo de Medici, e da
alcuni cardinali e baroni romani a marciare alla volta di Roma
coll'armi sue, perchè avrebbe facilmente indotto per forza il pontefice
ad un buon accordo [Neri Capponi, Comment., tom. 18 Rer. Ital. Simonetta,
Vit. Francisci Sfortiae, lib. 8, tom. 21 Rer. Ital.]. Gli promettevano ancora la
ribellione di Todi, Narni e di Orvieto, con altri aderenti. Ma egli pensò
a mettersi in viaggio, ed ancorchè si movesse sul fine di maggio per
passare colà, ed arrivasse fino a Montefiascone e a Viterbo, pure per
mancanza di vettovaglie, e perchè Todi ed Orvieto non corrisposero
alle speranze dategli, gli convenne tornare indietro. Intanto il papa si
provvide di gente, avendo chiamato in suo aiuto un corpo di quelle
del re Alfonso, e Taliano Furlano ed altri condottieri, ch'erano nella
Marca. Queste truppe dipoi, tornato che fu indietro il conte
Francesco, se ne andarono addosso ad Ancona, città che dianzi avea
fatta lega co' Veneziani, per non venir nelle mani del papa, e la
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!
ebookultra.com

More Related Content

PDF
Creare API pubbliche, come evitare gli errori comuni
PPTX
Fondamenti di REST API (1/3) - I protocolli HTTP e HTTPS
PPT
Come funziona la navigazione Web
PDF
Download Full Object Storage with Swift Cloud storage administration through ...
PDF
Architetture web - Linguaggi e standard - Web server, application server, dat...
PPT
4 - Introduzione al Web (1/2) - 16/17
PDF
Apache Parte 2
PDF
Sistemi distribuiti
Creare API pubbliche, come evitare gli errori comuni
Fondamenti di REST API (1/3) - I protocolli HTTP e HTTPS
Come funziona la navigazione Web
Download Full Object Storage with Swift Cloud storage administration through ...
Architetture web - Linguaggi e standard - Web server, application server, dat...
4 - Introduzione al Web (1/2) - 16/17
Apache Parte 2
Sistemi distribuiti

Similar to HTTP The Definitive Guide 1st Edition David Gourley (20)

PDF
Laboratorio Di Basi Di Dati 05 Architettura Del Web
PPTX
World wide web
PDF
Html5 Designing Rich Internet Applications Visualizing The Web Matthew David
PPTX
Le Applicazioni di Internet Web, FTP, Posta e App pr il Mobile
PDF
Download full ebook of Ajax in Action 1st Edition Dave Crane instant download...
KEY
RESTful APIs (ITA) - /w WebMachine
PDF
API Security in Action 1st Edition Neil Madden
PDF
Gli HTTP Security Header e altri elementi da sapere su HTTP in un Web Applica...
PDF
Html e Css - 1 | WebMaster & WebDesigner
PPT
5. Applicazioni Web e CMS
PDF
Happy Monday #1: the Web API guidelines for happy developers
PDF
Corso di servlet jsp e pattern
PDF
Corso PHP ENAIP - lezione #01 - 17/01/2014
PDF
Smau Roma 2012 Mob App Camp put social in your app
PDF
Html e Css - 1 | WebMaster & WebDesigner
PDF
Introduzione a node: cenni storici ecc
PPTX
Applicazioni web based
PDF
Web service architetture e standard - Tesi - cap1
PDF
Hosting: storia del protocollo http
PPT
04 - Introduzione al Web I
Laboratorio Di Basi Di Dati 05 Architettura Del Web
World wide web
Html5 Designing Rich Internet Applications Visualizing The Web Matthew David
Le Applicazioni di Internet Web, FTP, Posta e App pr il Mobile
Download full ebook of Ajax in Action 1st Edition Dave Crane instant download...
RESTful APIs (ITA) - /w WebMachine
API Security in Action 1st Edition Neil Madden
Gli HTTP Security Header e altri elementi da sapere su HTTP in un Web Applica...
Html e Css - 1 | WebMaster & WebDesigner
5. Applicazioni Web e CMS
Happy Monday #1: the Web API guidelines for happy developers
Corso di servlet jsp e pattern
Corso PHP ENAIP - lezione #01 - 17/01/2014
Smau Roma 2012 Mob App Camp put social in your app
Html e Css - 1 | WebMaster & WebDesigner
Introduzione a node: cenni storici ecc
Applicazioni web based
Web service architetture e standard - Tesi - cap1
Hosting: storia del protocollo http
04 - Introduzione al Web I
Ad

Recently uploaded (8)

PDF
Presentazione educazione finanziaria e informazione.pdf
PDF
NGÂN HÀNG CÂU HỎI TÁCH CHỌN LỌC THEO CHUYÊN ĐỀ TỪ ĐỀ THI THỬ TN THPT 2025 TIẾ...
PPTX
San Giovanni Eudes, 1601 – 1680, sacerdote e fondatore francese.pptx
PDF
NGÂN HÀNG CÂU HỎI TÁCH CHỌN LỌC THEO CHUYÊN ĐỀ TỪ ĐỀ THI THỬ TN THPT 2025 TIẾ...
PDF
Presentazione di Chimica sui Coloranti Alimentari
PDF
NGÂN HÀNG CÂU HỎI TÁCH CHỌN LỌC THEO CHUYÊN ĐỀ TỪ ĐỀ THI THỬ TN THPT 2025 TIẾ...
PDF
Critico_o_creativo_Approcci_al_testo_let.pdf
PPTX
Santa Rosa da Lima, Vergine, Penitente, Terziaria Domenicana 1586-1617.pptx
Presentazione educazione finanziaria e informazione.pdf
NGÂN HÀNG CÂU HỎI TÁCH CHỌN LỌC THEO CHUYÊN ĐỀ TỪ ĐỀ THI THỬ TN THPT 2025 TIẾ...
San Giovanni Eudes, 1601 – 1680, sacerdote e fondatore francese.pptx
NGÂN HÀNG CÂU HỎI TÁCH CHỌN LỌC THEO CHUYÊN ĐỀ TỪ ĐỀ THI THỬ TN THPT 2025 TIẾ...
Presentazione di Chimica sui Coloranti Alimentari
NGÂN HÀNG CÂU HỎI TÁCH CHỌN LỌC THEO CHUYÊN ĐỀ TỪ ĐỀ THI THỬ TN THPT 2025 TIẾ...
Critico_o_creativo_Approcci_al_testo_let.pdf
Santa Rosa da Lima, Vergine, Penitente, Terziaria Domenicana 1586-1617.pptx
Ad

HTTP The Definitive Guide 1st Edition David Gourley

  • 1. Visit https://ebookultra.com to download the full version and explore more ebooks HTTP The Definitive Guide 1st Edition David Gourley _____ Click the link below to download _____ https://ebookultra.com/download/http-the-definitive- guide-1st-edition-david-gourley/ Explore and download more ebooks at ebookultra.com
  • 2. Here are some suggested products you might be interested in. Click the link to download JavaScript The Definitive Guide 5th Edition David Flanagan https://ebookultra.com/download/javascript-the-definitive-guide-5th- edition-david-flanagan/ JavaScript The Definitive Guide 6th Edition David Flanagan https://ebookultra.com/download/javascript-the-definitive-guide-6th- edition-david-flanagan/ Animal The Definitive Visual Guide 3rd Edition David Burnie https://ebookultra.com/download/animal-the-definitive-visual- guide-3rd-edition-david-burnie/ AppleScript The Definitive Guide 2nd Edition The Definitive Guide https://ebookultra.com/download/applescript-the-definitive-guide-2nd- edition-the-definitive-guide/
  • 3. DK Smithsonian Animal The Definitive Visual Guide Third Edition David Burnie https://ebookultra.com/download/dk-smithsonian-animal-the-definitive- visual-guide-third-edition-david-burnie/ NetBeans The Definitive Guide 1st Edition Tim Boudreau https://ebookultra.com/download/netbeans-the-definitive-guide-1st- edition-tim-boudreau/ MongoDB The Definitive Guide 1st Edition Kristina Chodorow https://ebookultra.com/download/mongodb-the-definitive-guide-1st- edition-kristina-chodorow/ Mercurial The Definitive Guide 1st Edition Bryan O'Sullivan https://ebookultra.com/download/mercurial-the-definitive-guide-1st- edition-bryan-osullivan/ Maven The Definitive Guide 1st Edition Sonatype Company https://ebookultra.com/download/maven-the-definitive-guide-1st- edition-sonatype-company/
  • 5. HTTP The Definitive Guide 1st Edition David Gourley Digital Instant Download Author(s): David Gourley, Brian Totty ISBN(s): 9781565925090, 1565925092 Edition: 1 File Details: PDF, 9.52 MB Year: 2002 Language: english
  • 10. HTTP The Definitive Guide David Gourley and Brian Totty with Marjorie Sayer, Sailu Reddy, and Anshu Aggarwal Beijing • Cambridge • Farnham • Köln • Paris • Sebastopol • Taipei • Tokyo
  • 11. HTTP: The Definitive Guide by David Gourley and Brian Totty with Marjorie Sayer, Sailu Reddy, and Anshu Aggarwal Copyright © 2002 O’Reilly Media, Inc. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly Media, Inc. books may be purchased for educational, business, or sales promotional use. On- line editions are also available for most titles (safari.oreilly.com). For more information, contact our cor- porate/institutional sales department: (800) 998-9938 or corporate@oreilly.com. Editor: Linda Mui Production Editor: Rachel Wheeler Cover Designer: Ellie Volckhausen Interior Designers: David Futato and Melanie Wang Printing History: September 2002: First Edition. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. HTTP: The Definitive Guide, the image of a thirteen-lined ground squirrel, and related trade dress are trademarks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein. This book uses RepKover™ , a durable and flexible lay-flat binding. ISBN-10: 1-56592-509-2 ISBN-13: 978-1-56592-509-0 [C] [01/08]
  • 12. v Table of Contents Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii Part I. HTTP: The Web’s Foundation 1. Overview of HTTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 HTTP: The Internet’s Multimedia Courier 3 Web Clients and Servers 4 Resources 4 Transactions 8 Messages 10 Connections 11 Protocol Versions 16 Architectural Components of the Web 17 The End of the Beginning 21 For More Information 21 2. URLs and Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Navigating the Internet’s Resources 24 URL Syntax 26 URL Shortcuts 30 Shady Characters 35 A Sea of Schemes 38 The Future 40 For More Information 41 3. HTTP Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 The Flow of Messages 43 The Parts of a Message 44
  • 13. vi | Table of Contents Methods 53 Status Codes 59 Headers 67 For More Information 73 4. Connection Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 TCP Connections 74 TCP Performance Considerations 80 HTTP Connection Handling 86 Parallel Connections 88 Persistent Connections 90 Pipelined Connections 99 The Mysteries of Connection Close 101 For More Information 104 Part II. HTTP Architecture 5. Web Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Web Servers Come in All Shapes and Sizes 109 A Minimal Perl Web Server 111 What Real Web Servers Do 113 Step 1: Accepting Client Connections 115 Step 2: Receiving Request Messages 116 Step 3: Processing Requests 120 Step 4: Mapping and Accessing Resources 120 Step 5: Building Responses 125 Step 6: Sending Responses 127 Step 7: Logging 127 For More Information 127 6. Proxies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 Web Intermediaries 129 Why Use Proxies? 131 Where Do Proxies Go? 137 Client Proxy Settings 141 Tricky Things About Proxy Requests 144 Tracing Messages 150 Proxy Authentication 156
  • 14. Table of Contents | vii Proxy Interoperation 157 For More Information 160 7. Caching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 Redundant Data Transfers 161 Bandwidth Bottlenecks 161 Flash Crowds 163 Distance Delays 163 Hits and Misses 164 Cache Topologies 168 Cache Processing Steps 171 Keeping Copies Fresh 175 Controlling Cachability 182 Setting Cache Controls 186 Detailed Algorithms 187 Caches and Advertising 194 For More Information 196 8. Integration Points: Gateways, Tunnels, and Relays . . . . . . . . . . . . . . . . . . . . 197 Gateways 197 Protocol Gateways 200 Resource Gateways 203 Application Interfaces and Web Services 205 Tunnels 206 Relays 212 For More Information 213 9. Web Robots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 Crawlers and Crawling 215 Robotic HTTP 225 Misbehaving Robots 228 Excluding Robots 229 Robot Etiquette 239 Search Engines 242 For More Information 246 10. HTTP-NG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 HTTP’s Growing Pains 247 HTTP-NG Activity 248
  • 15. viii | Table of Contents Modularize and Enhance 248 Distributed Objects 249 Layer 1: Messaging 250 Layer 2: Remote Invocation 250 Layer 3: Web Application 251 WebMUX 251 Binary Wire Protocol 252 Current Status 252 For More Information 253 Part III. Identification, Authorization, and Security 11. Client Identification and Cookies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 The Personal Touch 257 HTTP Headers 258 Client IP Address 259 User Login 260 Fat URLs 262 Cookies 263 For More Information 276 12. Basic Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 Authentication 277 Basic Authentication 281 The Security Flaws of Basic Authentication 283 For More Information 285 13. Digest Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286 The Improvements of Digest Authentication 286 Digest Calculations 291 Quality of Protection Enhancements 299 Practical Considerations 300 Security Considerations 303 For More Information 306 14. Secure HTTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 Making HTTP Safe 307 Digital Cryptography 309
  • 16. Table of Contents | ix Symmetric-Key Cryptography 313 Public-Key Cryptography 315 Digital Signatures 317 Digital Certificates 319 HTTPS: The Details 322 A Real HTTPS Client 328 Tunneling Secure Traffic Through Proxies 335 For More Information 336 Part IV. Entities, Encodings, and Internationalization 15. Entities and Encodings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341 Messages Are Crates, Entities Are Cargo 342 Content-Length: The Entity’s Size 344 Entity Digests 347 Media Type and Charset 348 Content Encoding 351 Transfer Encoding and Chunked Encoding 354 Time-Varying Instances 359 Validators and Freshness 360 Range Requests 363 Delta Encoding 365 For More Information 369 16. Internationalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370 HTTP Support for International Content 370 Character Sets and HTTP 371 Multilingual Character Encoding Primer 376 Language Tags and HTTP 384 Internationalized URIs 389 Other Considerations 392 For More Information 392 17. Content Negotiation and Transcoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395 Content-Negotiation Techniques 395 Client-Driven Negotiation 396 Server-Driven Negotiation 397 Transparent Negotiation 400
  • 17. x | Table of Contents Transcoding 403 Next Steps 405 For More Information 406 Part V. Content Publishing and Distribution 18. Web Hosting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411 Hosting Services 411 Virtual Hosting 413 Making Web Sites Reliable 419 Making Web Sites Fast 422 For More Information 423 19. Publishing Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424 FrontPage Server Extensions for Publishing Support 424 WebDAV and Collaborative Authoring 429 For More Information 446 20. Redirection and Load Balancing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448 Why Redirect? 449 Where to Redirect 449 Overview of Redirection Protocols 450 General Redirection Methods 452 Proxy Redirection Methods 462 Cache Redirection Methods 469 Internet Cache Protocol 473 Cache Array Routing Protocol 475 Hyper Text Caching Protocol 478 For More Information 481 21. Logging and Usage Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483 What to Log? 483 Log Formats 484 Hit Metering 492 A Word on Privacy 495 For More Information 495
  • 18. Table of Contents | xi Part VI. Appendixes A. URI Schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499 B. HTTP Status Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505 C. HTTP Header Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508 D. MIME Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533 E. Base-64 Encoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570 F. Digest Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574 G. Language Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581 H. MIME Charset Registry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
  • 20. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. xiii Preface The Hypertext Transfer Protocol (HTTP) is the protocol programs use to communi- cate over the World Wide Web. There are many applications of HTTP, but HTTP is most famous for two-way conversation between web browsers and web servers. HTTP began as a simple protocol, so you might think there really isn’t that much to say about it. And yet here you stand, with a two-pound book in your hands. If you’re wondering how we could have written 650 pages on HTTP, take a look at the Table of Contents. This book isn’t just an HTTP header reference manual; it’s a veritable bible of web architecture. In this book, we try to tease apart HTTP’s interrelated and often misunderstood rules, and we offer you a series of topic-based chapters that explain all the aspects of HTTP. Throughout the book, we are careful to explain the “why” of HTTP, not just the “how.” And to save you time chasing references, we explain many of the critical non-HTTP technologies that are required to make HTTP applications work. You can find the alphabetical header reference (which forms the basis of most conventional HTTP texts) in a conveniently organized appendix. We hope this conceptual design makes it easy for you to work with HTTP. This book is written for anyone who wants to understand HTTP and the underlying architecture of the Web. Software and hardware engineers can use this book as a coherent reference for HTTP and related web technologies. Systems architects and network administrators can use this book to better understand how to design, deploy, and manage complicated web architectures. Performance engineers and ana- lysts can benefit from the sections on caching and performance optimization. Mar- keting and consulting professionals will be able to use the conceptual orientation to better understand the landscape of web technologies. This book illustrates common misconceptions, advises on “tricks of the trade,” pro- vides convenient reference material, and serves as a readable introduction to dry and confusing standards specifications. In a single book, we detail the essential and inter- related technologies that make the Web work.
  • 21. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. xiv | Preface This book is the result of a tremendous amount of work by many people who share an enthusiasm for Internet technologies. We hope you find it useful. Running Example: Joe’s Hardware Store Many of our chapters include a running example of a hypothetical online hardware and home-improvement store called “Joe’s Hardware” to demonstrate technology concepts. We have set up a real web site for the store (http://www.joes-hardware. com) for you to test some of the examples in the book. We will maintain this web site while this book remains in print. Chapter-by-Chapter Guide This book contains 21 chapters, divided into 5 logical parts (each with a technology theme), and 8 useful appendixes containing reference data and surveys of related technologies: Part I, HTTP: The Web’s Foundation Part II, HTTP Architecture Part III, Identification, Authorization, and Security Part IV, Entities, Encodings, and Internationalization Part V, Content Publishing and Distribution Part VI, Appendixes Part I, HTTP: The Web’s Foundation, describes the core technology of HTTP, the foundation of the Web, in four chapters: • Chapter 1, Overview of HTTP, is a rapid-paced overview of HTTP. • Chapter 2, URLs and Resources, details the formats of uniform resource locators (URLs) and the various types of resources that URLs name across the Internet. It also outlines the evolution to uniform resource names (URNs). • Chapter 3, HTTP Messages, details how HTTP messages transport web content. • Chapter 4, Connection Management, explains the commonly misunderstood and poorly documented rules and behavior for managing HTTP connections. Part II, HTTP Architecture, highlights the HTTP server, proxy, cache, gateway, and robot applications that are the architectural building blocks of web systems. (Web browsers are another building block, of course, but browsers already were covered thoroughly in Part I of the book.) Part II contains the following six chapters: • Chapter 5, Web Servers, gives an overview of web server architectures. • Chapter 6, Proxies, explores HTTP proxy servers, which are intermediary serv- ers that act as platforms for HTTP services and controls. • Chapter 7, Caching, delves into the science of web caches—devices that improve performance and reduce traffic by making local copies of popular documents.
  • 22. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. Preface | xv • Chapter 8, Integration Points: Gateways, Tunnels, and Relays, explains gateways and application servers that allow HTTP to work with software that speaks dif- ferent protocols, including Secure Sockets Layer (SSL) encrypted protocols. • Chapter 9, Web Robots, describes the various types of clients that pervade the Web, including the ubiquitous browsers, robots and spiders, and search engines. • Chapter 10, HTTP-NG, talks about HTTP developments still in the works: the HTTP-NG protocol. Part III, Identification, Authorization, and Security, presents a suite of techniques and technologies to track identity, enforce security, and control access to content. It con- tains the following four chapters: • Chapter 11, Client Identification and Cookies, talks about techniques to identify users so that content can be personalized to the user audience. • Chapter 12, Basic Authentication, highlights the basic mechanisms to verify user identity. The chapter also examines how HTTP authentication interfaces with databases. • Chapter 13, Digest Authentication, explains digest authentication, a complex proposed enhancement to HTTP that provides significantly enhanced security. • Chapter 14, Secure HTTP, is a detailed overview of Internet cryptography, digi- tal certificates, and SSL. Part IV, Entities, Encodings, and Internationalization, focuses on the bodies of HTTP messages (which contain the actual web content) and on the web standards that describe and manipulate content stored in the message bodies. Part IV contains three chapters: • Chapter 15, Entities and Encodings, describes the structure of HTTP content. • Chapter 16, Internationalization, surveys the web standards that allow users around the globe to exchange content in different languages and character sets. • Chapter 17, Content Negotiation and Transcoding, explains mechanisms for negotiating acceptable content. Part V, Content Publishing and Distribution, discusses the technology for publishing and disseminating web content. It contains four chapters: • Chapter 18, Web Hosting, discusses the ways people deploy servers in modern web hosting environments and HTTP support for virtual web hosting. • Chapter 19, Publishing Systems, discusses the technologies for creating web con- tent and installing it onto web servers. • Chapter 20, Redirection and Load Balancing, surveys the tools and techniques for distributing incoming web traffic among a collection of servers. • Chapter 21, Logging and Usage Tracking, covers log formats and common questions.
  • 23. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. xvi | Preface Part VI, Appendixes, contains helpful reference appendixes and tutorials in related technologies: • Appendix A, URI Schemes, summarizes the protocols supported through uni- form resource identifier (URI) schemes. • Appendix B, HTTP Status Codes, conveniently lists the HTTP response codes. • Appendix C, HTTP Header Reference, provides a reference list of HTTP header fields. • Appendix D, MIME Types, provides an extensive list of MIME types and explains how MIME types are registered. • Appendix E, Base-64 Encoding, explains base-64 encoding, used by HTTP authentication. • Appendix F, Digest Authentication, gives details on how to implement various authentication schemes in HTTP. • Appendix G, Language Tags, defines language tag values for HTTP language headers. • Appendix H, MIME Charset Registry, provides a detailed list of character encod- ings, used for HTTP internationalization support. Each chapter contains many examples and pointers to additional reference material. Typographic Conventions In this book, we use the following typographic conventions: Italic Used for URLs, C functions, command names, MIME types, new terms where they are defined, and emphasis Constant width Used for computer output, code, and any literal text Constant width bold Used for user input Comments and Questions Please address comments and questions concerning this book to the publisher: O’Reilly & Associates, Inc. 1005 Gravenstein Highway North Sebastopol, CA 95472 (800) 998-9938 (in the United States or Canada) (707) 829-0515 (international/local) (707) 829-0104 (fax)
  • 24. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. Preface | xvii There is a web page for this book, which lists errata, examples, or any additional information. You can access this page at: http://www.oreilly.com/catalog/httptdg/ To comment or ask technical questions about this book, send email to: bookquestions@oreilly.com For more information about books, conferences, Resource Centers, and the O’Reilly Network, see the O’Reilly web site at: http://www.oreilly.com Acknowledgments This book is the labor of many. The five authors would like to hold up a few people in thanks for their significant contributions to this project. To start, we’d like to thank Linda Mui, our editor at O’Reilly. Linda first met with David and Brian way back in 1996, and she refined and steered several concepts into the book you hold today. Linda also helped keep our wandering gang of first-time book authors moving in a coherent direction and on a progressing (if not rapid) time- line. Most of all, Linda gave us the chance to create this book. We’re very grateful. We’d also like to thank several tremendously bright, knowledgeable, and kind souls who devoted noteworthy energy to reviewing, commenting on, and correcting drafts of this book. These include Tony Bourke, Sean Burke, Mike Chowla, Shernaz Daver, Fred Douglis, Paula Ferguson, Vikas Jha, Yves Lafon, Peter Mattis, Chuck Neer- daels, Luis Tavera, Duane Wessels, Dave Wu, and Marco Zagha. Their viewpoints and suggestions have improved the book tremendously. Rob Romano from O’Reilly created most of the amazing artwork you’ll find in this book. The book contains an unusually large number of detailed illustrations that make subtle concepts very clear. Many of these illustrations were painstakingly cre- ated and revised numerous times. If a picture is worth a thousand words, Rob added hundreds of pages of value to this book. Brian would like to personally thank all of the authors for their dedication to this project. A tremendous amount of time was invested by the authors in a challenge to make the first detailed but accessible treatment of HTTP. Weddings, childbirths, killer work projects, startup companies, and graduate schools intervened, but the authors held together to bring this project to a successful completion. We believe the result is worthy of everyone’s hard work and, most importantly, that it provides a valuable service. Brian also would like to thank the employees of Inktomi for their enthusiasm and support and for their deep insights about the use of HTTP in real- world applications. Also, thanks to the fine folks at Cajun-shop.com for allowing us to use their site for some of the examples in this book.
  • 25. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. xviii | Preface David would like to thank his family, particularly his mother and grandfather for their ongoing support. He’d like to thank those that have put up with his erratic schedule over the years writing the book. He’d also like to thank Slurp, Orctomi, and Norma for everything they’ve done, and his fellow authors for all their hard work. Finally, he would like to thank Brian for roping him into yet another adventure. Marjorie would like to thank her husband, Alan Liu, for technical insight, familial support and understanding. Marjorie thanks her fellow authors for many insights and inspirations. She is grateful for the experience of working together on this book. Sailu would like to thank David and Brian for the opportunity to work on this book, and Chuck Neerdaels for introducing him to HTTP. Anshu would like to thank his wife, Rashi, and his parents for their patience, sup- port, and encouragement during the long years spent writing this book. Finally, the authors collectively thank the famous and nameless Internet pioneers, whose research, development, and evangelism over the past four decades contrib- uted so much to our scientific, social, and economic community. Without these labors, there would be no subject for this book.
  • 26. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. PART I I. HTTP: The Web’s Foundation This section is an introduction to the HTTP protocol. The next four chapters describe the core technology of HTTP, the foundation of the Web: • Chapter 1, Overview of HTTP, is a rapid-paced overview of HTTP. • Chapter 2, URLs and Resources, details the formats of URLs and the various types of resources that URLs name across the Internet. We also outline the evo- lution to URNs. • Chapter 3, HTTP Messages, details the HTTP messages that transport web content. • Chapter 4, Connection Management, discusses the commonly misunderstood and poorly documented rules and behavior for managing TCP connections by HTTP.
  • 28. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. 3 Chapter 1This is the Title of the Book CHAPTER 1 Overview of HTTP The world’s web browsers, servers, and related web applications all talk to each other through HTTP, the Hypertext Transfer Protocol. HTTP is the common lan- guage of the modern global Internet. This chapter is a concise overview of HTTP. You’ll see how web applications use HTTP to communicate, and you’ll get a rough idea of how HTTP does its job. In particular, we talk about: • How web clients and servers communicate • Where resources (web content) come from • How web transactions work • The format of the messages used for HTTP communication • The underlying TCP network transport • The different variations of the HTTP protocol • Some of the many HTTP architectural components installed around the Internet We’ve got a lot of ground to cover, so let’s get started on our tour of HTTP. HTTP: The Internet’s Multimedia Courier Billions of JPEG images, HTML pages, text files, MPEG movies, WAV audio files, Java applets, and more cruise through the Internet each and every day. HTTP moves the bulk of this information quickly, conveniently, and reliably from web servers all around the world to web browsers on people’s desktops. Because HTTP uses reliable data-transmission protocols, it guarantees that your data will not be damaged or scrambled in transit, even when it comes from the other side of the globe. This is good for you as a user, because you can access information without worrying about its integrity. Reliable transmission is also good for you as an Internet application developer, because you don’t have to worry about HTTP communications
  • 29. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. 4 | Chapter 1: Overview of HTTP being destroyed, duplicated, or distorted in transit. You can focus on programming the distinguishing details of your application, without worrying about the flaws and foibles of the Internet. Let’s look more closely at how HTTP transports the Web’s traffic. Web Clients and Servers Web content lives on web servers. Web servers speak the HTTP protocol, so they are often called HTTP servers. These HTTP servers store the Internet’s data and provide the data when it is requested by HTTP clients. The clients send HTTP requests to servers, and servers return the requested data in HTTP responses, as sketched in Figure 1-1. Together, HTTP clients and HTTP servers make up the basic compo- nents of the World Wide Web. You probably use HTTP clients every day. The most common client is a web browser, such as Microsoft Internet Explorer or Netscape Navigator. Web browsers request HTTP objects from servers and display the objects on your screen. When you browse to a page, such as “http://www.oreilly.com/index.html,” your browser sends an HTTP request to the server www.oreilly.com (see Figure 1-1). The server tries to find the desired object (in this case, “/index.html”) and, if successful, sends the object to the client in an HTTP response, along with the type of the object, the length of the object, and other information. Resources Web servers host web resources. A web resource is the source of web content. The simplest kind of web resource is a static file on the web server’s filesystem. These files can contain anything: they might be text files, HTML files, Microsoft Word files, Adobe Acrobat files, JPEG image files, AVI movie files, or any other format you can think of. However, resources don’t have to be static files. Resources can also be software pro- grams that generate content on demand. These dynamic content resources can gen- erate content based on your identity, on what information you’ve requested, or on Figure 1-1. Web clients and servers HTTP request “Get me the document called /index.html.” Client Server www.oreilly.com HTTP response “Okay,here it is,it’s in HTML format and is 3,150 characters long.”
  • 30. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. Resources | 5 the time of day. They can show you a live image from a camera, or let you trade stocks, search real estate databases, or buy gifts from online stores (see Figure 1-2). In summary, a resource is any kind of content source. A file containing your com- pany’s sales forecast spreadsheet is a resource. A web gateway to scan your local public library’s shelves is a resource. An Internet search engine is a resource. Media Types Because the Internet hosts many thousands of different data types, HTTP carefully tags each object being transported through the Web with a data format label called a MIME type. MIME (Multipurpose Internet Mail Extensions) was originally designed to solve problems encountered in moving messages between different electronic mail systems. MIME worked so well for email that HTTP adopted it to describe and label its own multimedia content. Web servers attach a MIME type to all HTTP object data (see Figure 1-3). When a web browser gets an object back from a server, it looks at the associated MIME type to see if it knows how to handle the object. Most browsers can handle hundreds of popular object types: displaying image files, parsing and formatting HTML files, playing audio files through the computer’s speakers, or launching external plug-in software to handle special formats. Figure 1-2. A web resource is anything that provides web content Client Server Internet E-commerce gateway Realestatesearch gateway Stocktrading gateway Webcam gateway 11000101101 Imagefile Textfile Filesystem Resources
  • 31. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. 6 | Chapter 1: Overview of HTTP A MIME type is a textual label, represented as a primary object type and a specific subtype, separated by a slash. For example: • An HTML-formatted text document would be labeled with type text/html. • A plain ASCII text document would be labeled with type text/plain. • A JPEG version of an image would be image/jpeg. • A GIF-format image would be image/gif. • An Apple QuickTime movie would be video/quicktime. • A Microsoft PowerPoint presentation would be application/vnd.ms-powerpoint. There are hundreds of popular MIME types, and many more experimental or limited- use types. A very thorough MIME type list is provided in Appendix D. URIs Each web server resource has a name, so clients can point out what resources they are interested in. The server resource name is called a uniform resource identifier, or URI. URIs are like the postal addresses of the Internet, uniquely identifying and locating information resources around the world. Here’s a URI for an image resource on Joe’s Hardware store’s web server: http://www.joes-hardware.com/specials/saw-blade.gif Figure 1-4 shows how the URI specifies the HTTP protocol to access the saw-blade GIF resource on Joe’s store’s server. Given the URI, HTTP can retrieve the object. URIs come in two flavors, called URLs and URNs. Let’s take a peek at each of these types of resource identifiers now. URLs The uniform resource locator (URL) is the most common form of resource identifier. URLs describe the specific location of a resource on a particular server. They tell you exactly how to fetch a resource from a precise, fixed location. Figure 1-4 shows how a URL tells precisely where a resource is located and how to access it. Table 1-1 shows a few examples of URLs. Figure 1-3. MIME types are sent back with the data content Client Server Content-type: image/jpeg Content-length: 12984 MIMEtype
  • 32. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. Resources | 7 Most URLs follow a standardized format of three main parts: • The first part of the URL is called the scheme, and it describes the protocol used to access the resource. This is usually the HTTP protocol (http://). • The second part gives the server Internet address (e.g., www.joes-hardware.com). • The rest names a resource on the web server (e.g., /specials/saw-blade.gif ). Today, almost every URI is a URL. URNs The second flavor of URI is the uniform resource name, or URN. A URN serves as a unique name for a particular piece of content, independent of where the resource currently resides. These location-independent URNs allow resources to move from place to place. URNs also allow resources to be accessed by multiple network access protocols while maintaining the same name. For example, the following URN might be used to name the Internet standards docu- ment “RFC 2141” regardless of where it resides (it may even be copied in several places): urn:ietf:rfc:2141 Figure 1-4. URLs specify protocol, server, and local resource Table 1-1. Example URLs URL Description http://www.oreilly.com/index.html The home URL for O’Reilly & Associates, Inc. http://www.yahoo.com/images/logo.gif The URL for the Yahoo! web site’s logo http://www.joes-hardware.com/inventory-check. cgi?item=12731 The URL for a program that checks if inventory item #12731 is in stock ftp://joe:tools4u@ftp.joes-hardware.com/locking- pliers.gif The URL for the locking-pliers.gif image file, using password-protected FTP as the access protocol Client www.joes-hardware.com Content-type: image/gif Content-length: 8572 http://www.joes-hardware.com/specials/saw-blade.gif UseHTTPprotocol Gotowww.joes-hardware.com Grabtheresourcecalled/specials/saw-blade.gif 1 2 3
  • 33. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. 8 | Chapter 1: Overview of HTTP URNs are still experimental and not yet widely adopted. To work effectively, URNs need a supporting infrastructure to resolve resource locations; the lack of such an infrastructure has also slowed their adoption. But URNs do hold some exciting promise for the future. We’ll discuss URNs in a bit more detail in Chapter 2, but most of the remainder of this book focuses almost exclusively on URLs. Unless stated otherwise, we adopt the conventional terminology and use URI and URL interchangeably for the remainder of this book. Transactions Let’s look in more detail how clients use HTTP to transact with web servers and their resources. An HTTP transaction consists of a request command (sent from cli- ent to server), and a response result (sent from the server back to the client). This communication happens with formatted blocks of data called HTTP messages, as illustrated in Figure 1-5. Methods HTTP supports several different request commands, called HTTP methods. Every HTTP request message has a method. The method tells the server what action to per- form (fetch a web page, run a gateway program, delete a file, etc.). Table 1-2 lists five common HTTP methods. Figure 1-5. HTTP transactions consist of request and response messages Table 1-2. Some common HTTP methods HTTP method Description GET Send named resource from the server to the client. PUT Store data from client into a named server resource. Internet HTTPrequestmessagecontains thecommandandtheURI GET /specials/saw-blade.gif HTTP/1.0 Host: www.joes-hardware.com Client www.joes-hardware.com HTTP/1.0 200 OK Content-type: image/gif Content-length: 8572 HTTPresponsemessagecontains theresultofthetransaction
  • 34. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. Transactions | 9 We’ll discuss HTTP methods in detail in Chapter 3. Status Codes Every HTTP response message comes back with a status code. The status code is a three-digit numeric code that tells the client if the request succeeded, or if other actions are required. A few common status codes are shown in Table 1-3. HTTP also sends an explanatory textual “reason phrase” with each numeric status code (see the response message in Figure 1-5). The textual phrase is included only for descriptive purposes; the numeric code is used for all processing. The following status codes and reason phrases are treated identically by HTTP soft- ware: 200 OK 200 Document attached 200 Success 200 All’s cool, dude HTTP status codes are explained in detail in Chapter 3. Web Pages Can Consist of Multiple Objects An application often issues multiple HTTP transactions to accomplish a task. For example, a web browser issues a cascade of HTTP transactions to fetch and display a graphics-rich web page. The browser performs one transaction to fetch the HTML “skeleton” that describes the page layout, then issues additional HTTP transactions for each embedded image, graphics pane, Java applet, etc. These embedded resources might even reside on different servers, as shown in Figure 1-6. Thus, a “web page” often is a collection of resources, not a single resource. DELETE Delete the named resource from a server. POST Send client data into a server gateway application. HEAD Send just the HTTP headers from the response for the named resource. Table 1-3. Some common HTTP status codes HTTP status code Description 200 OK. Document returned correctly. 302 Redirect. Go someplace else to get the resource. 404 Not Found. Can’t find this resource. Table 1-2. Some common HTTP methods (continued) HTTP method Description
  • 35. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. 10 | Chapter 1: Overview of HTTP Messages Now let’s take a quick look at the structure of HTTP request and response mes- sages. We’ll study HTTP messages in exquisite detail in Chapter 3. HTTP messages are simple, line-oriented sequences of characters. Because they are plain text, not binary, they are easy for humans to read and write.* Figure 1-7 shows the HTTP messages for a simple transaction. HTTP messages sent from web clients to web servers are called request messages. Messages from servers to clients are called response messages. There are no other kinds of HTTP messages. The formats of HTTP request and response messages are very similar. Figure 1-6. Composite web pages require separate HTTP transactions for each embedded resource * Some programmers complain about the difficulty of HTTP parsing, which can be tricky and error-prone, especially when designing high-speed software. A binary format or a more restricted text format might have been simpler to process, but most HTTP programmers appreciate HTTP’s extensibility and debuggability. Figure 1-7. HTTP messages have a simple, line-oriented text structure Client Server 1 Server 2 Internet GET /test/hi-there.txt HTTP/1.0 Accept: text/* Accept-Language: en,fr HTTP/1.0 200 OK Content-type: text/plain Content-length: 19 Hi! I’m a message! Startline Headers Body (a) Request message (b) Response message
  • 36. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. Connections | 11 HTTP messages consist of three parts: Start line The first line of the message is the start line, indicating what to do for a request or what happened for a response. Header fields Zero or more header fields follow the start line. Each header field consists of a name and a value, separated by a colon (:) for easy parsing. The headers end with a blank line. Adding a header field is as easy as adding another line. Body After the blank line is an optional message body containing any kind of data. Request bodies carry data to the web server; response bodies carry data back to the client. Unlike the start lines and headers, which are textual and structured, the body can contain arbitrary binary data (e.g., images, videos, audio tracks, software applications). Of course, the body can also contain text. Simple Message Example Figure 1-8 shows the HTTP messages that might be sent as part of a simple transac- tion. The browser requests the resource http://www.joes-hardware.com/tools.html. In Figure 1-8, the browser sends an HTTP request message. The request has a GET method in the start line, and the local resource is /tools.html. The request indicates it is speaking Version 1.0 of the HTTP protocol. The request message has no body, because no request data is needed to GET a simple document from a server. The server sends back an HTTP response message. The response contains the HTTP version number (HTTP/1.0), a success status code (200), a descriptive reason phrase (OK), and a block of response header fields, all followed by the response body con- taining the requested document. The response body length is noted in the Content- Length header, and the document’s MIME type is noted in the Content-Type header. Connections Now that we’ve sketched what HTTP’s messages look like, let’s talk for a moment about how messages move from place to place, across Transmission Control Protocol (TCP) connections. TCP/IP HTTP is an application layer protocol. HTTP doesn’t worry about the nitty-gritty details of network communication; instead, it leaves the details of networking to TCP/IP, the popular reliable Internet transport protocol.
  • 37. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. 12 | Chapter 1: Overview of HTTP TCP provides: • Error-free data transportation • In-order delivery (data will always arrive in the order in which it was sent) • Unsegmented data stream (can dribble out data in any size at any time) The Internet itself is based on TCP/IP, a popular layered set of packet-switched net- work protocols spoken by computers and network devices around the world. TCP/IP hides the peculiarities and foibles of individual networks and hardware, letting com- puters and networks of any type talk together reliably. Once a TCP connection is established, messages exchanged between the client and server computers will never be lost, damaged, or received out of order. In networking terms, the HTTP protocol is layered over TCP. HTTP uses TCP to transport its message data. Likewise, TCP is layered over IP (see Figure 1-9). Figure 1-8. Example GET transaction for http://www.joes-hardware.com/tools.html GET /tools.html HTTP/1.0 User-agent: Mozilla/4.75 [en] (Win98; U) Host: www.joes-hardware.com Accept: text/html, image/gif, image/jpeg Accept-language: en HTTP/1.0 200 OK Date: Sun, o1 Oct 2000 23:25:17 GMT Server: Apache/1.3.11 BSafe-SSL/1.38 (Unix) Last-modified: Tue, 04 Jul 2000 09:46:21 GMT Content-length: 403 Content-type: text/html <HTML> <HEAD><TITLE>Joe’s Tools</TITLE></HEAD> <BODY> <H1>Tools Page</H1> <H2>Hammers</H2> <P>Joe’s Hardware Online has the largest selection of hammers on the earth.</P> <H2><A NAME=drills></A>Drills</H2> <P>Joe’s Hardware has a complete line of cordless and corded drills, as well as the latest in plutonium-powered atomic drills, for those big around the house jobs./<P>... </BODY> </HTML> Client www.joes-hardware.com (a) Request message (b) Response message Requeststartline(command) Requestheaders Norequestbody Responsestartline (status) Responseheaders Responsebody
  • 38. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. Connections | 13 Connections, IP Addresses, and Port Numbers Before an HTTP client can send a message to a server, it needs to establish a TCP/IP connection between the client and server using Internet protocol (IP) addresses and port numbers. Setting up a TCP connection is sort of like calling someone at a corporate office. First, you dial the company’s phone number. This gets you to the right organization. Then, you dial the specific extension of the person you’re trying to reach. In TCP, you need the IP address of the server computer and the TCP port number associated with the specific software program running on the server. This is all well and good, but how do you get the IP address and port number of the HTTP server in the first place? Why, the URL, of course! We mentioned before that URLs are the addresses for resources, so naturally enough they can provide us with the IP address for the machine that has the resource. Let’s take a look at a few URLs: http://207.200.83.29:80/index.html http://www.netscape.com:80/index.html http://www.netscape.com/index.html The first URL has the machine’s IP address, “207.200.83.29”, and port number, “80”. The second URL doesn’t have a numeric IP address; it has a textual domain name, or hostname (“www.netscape.com”). The hostname is just a human-friendly alias for an IP address. Hostnames can easily be converted into IP addresses through a facility called the Domain Name Service (DNS), so we’re all set here, too. We will talk much more about DNS and URLs in Chapter 2. The final URL has no port number. When the port number is missing from an HTTP URL, you can assume the default value of port 80. With the IP address and port number, a client can easily communicate via TCP/IP. Figure 1-10 shows how a browser uses HTTP to display a simple HTML resource that resides on a distant server. Figure 1-9. HTTP network protocol stack HTTP Applicationlayer TCP Transportlayer IP Networklayer Network-specific link interface Datalinklayer Physical network hardware Physicallayer
  • 39. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. 14 | Chapter 1: Overview of HTTP Here are the steps: (a) The browser extracts the server’s hostname from the URL. (b) The browser converts the server’s hostname into the server’s IP address. (c) The browser extracts the port number (if any) from the URL. (d) The browser establishes a TCP connection with the web server. (e) The browser sends an HTTP request message to the server. (f) The server sends an HTTP response back to the browser. (g) The connection is closed, and the browser displays the document. Figure 1-10. Basic browser connection process Client Server Internet (d) Connect to 161.58.228.45 port 80 Client Server Internet (e) Send an HTTP GET request Client Server Internet (f) Read HTTP response from server Client Server Internet (g) Close the connection Screen shot needed User types in URL http://www.joes-hardware.com:80/tools.html (c) Get the port number (80) www.joes-hardware.com (a) Get the hostname (b) DNS Browsershowingpage
  • 40. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. Connections | 15 A Real Example Using Telnet Because HTTP uses TCP/IP, and is text-based, as opposed to using some obscure binary format, it is simple to talk directly to a web server. The Telnet utility connects your keyboard to a destination TCP port and connects the TCP port output back to your display screen. Telnet is commonly used for remote terminal sessions, but it can generally connect to any TCP server, including HTTP servers. You can use the Telnet utility to talk directly to web servers. Telnet lets you open a TCP connection to a port on a machine and type characters directly into the port. The web server treats you as a web client, and any data sent back on the TCP con- nection is displayed onscreen. Let’s use Telnet to interact with a real web server. We will use Telnet to fetch the document pointed to by the URL http://www.joes-hardware.com:80/tools.html (you can try this example yourself). Let’s review what should happen: • First, we need to look up the IP address of www.joes-hardware.com and open a TCP connection to port 80 on that machine. Telnet does this legwork for us. • Once the TCP connection is open, we need to type in the HTTP request. • When the request is complete (indicated by a blank line), the server should send back the content in an HTTP response and close the connection. Our example HTTP request for http://www.joes-hardware.com:80/tools.html is shown in Example 1-1. What we typed is shown in boldface. Example 1-1. An HTTP transaction using telnet % telnet www.joes-hardware.com 80 Trying 161.58.228.45... Connected to joes-hardware.com. Escape character is '^]'. GET /tools.html HTTP/1.1 Host: www.joes-hardware.com HTTP/1.1 200 OK Date: Sun, 01 Oct 2000 23:25:17 GMT Server: Apache/1.3.11 BSafe-SSL/1.38 (Unix) FrontPage/4.0.4.3 Last-Modified: Tue, 04 Jul 2000 09:46:21 GMT ETag: "373979-193-3961b26d" Accept-Ranges: bytes Content-Length: 403 Connection: close Content-Type: text/html
  • 41. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. 16 | Chapter 1: Overview of HTTP Telnet looks up the hostname and opens a connection to the www.joes-hardware.com web server, which is listening on port 80. The three lines after the command are out- put from Telnet, telling us it has established a connection. We then type in our basic request command, “GET /tools.html HTTP/1.1”, and send a Host header providing the original hostname, followed by a blank line, asking the server to GET us the resource “/tools.html” from the server www.joes-hardware.com. After that, the server responds with a response line, several response headers, a blank line, and finally the body of the HTML document. Beware that Telnet mimics HTTP clients well but doesn’t work well as a server. And automated Telnet scripting is no fun at all. For a more flexible tool, you might want to check out nc (netcat). The nc tool lets you easily manipulate and script UDP- and TCP-based traffic, including HTTP. See http://netcat. sourceforge.net for details. Protocol Versions There are several versions of the HTTP protocol in use today. HTTP applications need to work hard to robustly handle different variations of the HTTP protocol. The versions in use are: HTTP/0.9 The 1991 prototype version of HTTP is known as HTTP/0.9. This protocol con- tains many serious design flaws and should be used only to interoperate with legacy clients. HTTP/0.9 supports only the GET method, and it does not sup- port MIME typing of multimedia content, HTTP headers, or version numbers. HTTP/0.9 was originally defined to fetch simple HTML objects. It was soon replaced with HTTP/1.0. HTTP/1.0 1.0 was the first version of HTTP that was widely deployed. HTTP/1.0 added version numbers, HTTP headers, additional methods, and multimedia object handling. HTTP/1.0 made it practical to support graphically appealing web <HTML> <HEAD><TITLE>Joe's Tools</TITLE></HEAD> <BODY> <H1>Tools Page</H1> <H2>Hammers</H2> <P>Joe's Hardware Online has the largest selection of hammers on the earth.</P> <H2><A NAME=drills></A>Drills</H2> <P>Joe's Hardware has a complete line of cordless and corded drills, as well as the latest in plutonium-powered atomic drills, for those big around the house jobs.</P> ... </BODY> </HTML> Connection closed by foreign host. Example 1-1. An HTTP transaction using telnet (continued)
  • 42. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. Architectural Components of the Web | 17 pages and interactive forms, which helped promote the wide-scale adoption of the World Wide Web. This specification was never well specified. It represented a collection of best practices in a time of rapid commercial and academic evolu- tion of the protocol. HTTP/1.0+ Many popular web clients and servers rapidly added features to HTTP in the mid-1990s to meet the demands of a rapidly expanding, commercially success- ful World Wide Web. Many of these features, including long-lasting “keep- alive” connections, virtual hosting support, and proxy connection support, were added to HTTP and became unofficial, de facto standards. This informal, extended version of HTTP is often referred to as HTTP/1.0+. HTTP/1.1 HTTP/1.1 focused on correcting architectural flaws in the design of HTTP, spec- ifying semantics, introducing significant performance optimizations, and remov- ing mis-features. HTTP/1.1 also included support for the more sophisticated web applications and deployments that were under way in the late 1990s. HTTP/1.1 is the current version of HTTP. HTTP-NG (a.k.a. HTTP/2.0) HTTP-NG is a prototype proposal for an architectural successor to HTTP/1.1 that focuses on significant performance optimizations and a more powerful frame- work for remote execution of server logic. The HTTP-NG research effort con- cluded in 1998, and at the time of this writing, there are no plans to advance this proposal as a replacement for HTTP/1.1. See Chapter 10 for more information. Architectural Components of the Web In this overview chapter, we’ve focused on how two web applications (web browsers and web servers) send messages back and forth to implement basic transactions. There are many other web applications that you interact with on the Internet. In this section, we’ll outline several other important applications, including: Proxies HTTP intermediaries that sit between clients and servers Caches HTTP storehouses that keep copies of popular web pages close to clients Gateways Special web servers that connect to other applications Tunnels Special proxies that blindly forward HTTP communications Agents Semi-intelligent web clients that make automated HTTP requests
  • 43. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. 18 | Chapter 1: Overview of HTTP Proxies Let’s start by looking at HTTP proxy servers, important building blocks for web security, application integration, and performance optimization. As shown in Figure 1-11, a proxy sits between a client and a server, receiving all of the client’s HTTP requests and relaying the requests to the server (perhaps after modifying the requests). These applications act as a proxy for the user, accessing the server on the user’s behalf. Proxies are often used for security, acting as trusted intermediaries through which all web traffic flows. Proxies can also filter requests and responses; for example, to detect application viruses in corporate downloads or to filter adult content away from elementary-school students. We’ll talk about proxies in detail in Chapter 6. Caches A web cache or caching proxy is a special type of HTTP proxy server that keeps cop- ies of popular documents that pass through the proxy. The next client requesting the same document can be served from the cache’s personal copy (see Figure 1-12). Figure 1-11. Proxies relay traffic between client and server Figure 1-12. Caching proxies keep local copies of popular documents to improve performance Client Server Internet Proxy Client Server Internet Proxy cache Client
  • 44. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. Architectural Components of the Web | 19 A client may be able to download a document much more quickly from a nearby cache than from a distant web server. HTTP defines many facilities to make caching more effective and to regulate the freshness and privacy of cached content. We cover caching technology in Chapter 7. Gateways Gateways are special servers that act as intermediaries for other servers. They are often used to convert HTTP traffic to another protocol. A gateway always receives requests as if it was the origin server for the resource. The client may not be aware it is communicating with a gateway. For example, an HTTP/FTP gateway receives requests for FTP URIs via HTTP requests but fetches the documents using the FTP protocol (see Figure 1-13). The resulting document is packed into an HTTP message and sent to the client. We dis- cuss gateways in Chapter 8. Tunnels Tunnels are HTTP applications that, after setup, blindly relay raw data between two connections. HTTP tunnels are often used to transport non-HTTP data over one or more HTTP connections, without looking at the data. One popular use of HTTP tunnels is to carry encrypted Secure Sockets Layer (SSL) traffic through an HTTP connection, allowing SSL traffic through corporate fire- walls that permit only web traffic. As sketched in Figure 1-14, an HTTP/SSL tunnel receives an HTTP request to establish an outgoing connection to a destination address and port, then proceeds to tunnel the encrypted SSL traffic over the HTTP channel so that it can be blindly relayed to the destination server. Agents User agents (or just agents) are client programs that make HTTP requests on the user’s behalf. Any application that issues web requests is an HTTP agent. So far, we’ve talked about only one kind of HTTP agent: web browsers. But there are many other kinds of user agents. Figure 1-13. HTTP/FTP gateway HTTP client FTP server HTTP/FTP gateway HTTP FTP
  • 45. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. 20 | Chapter 1: Overview of HTTP For example, there are machine-automated user agents that autonomously wander the Web, issuing HTTP transactions and fetching content, without human supervi- sion. These automated agents often have colorful names, such as “spiders” or “web robots” (see Figure 1-15). Spiders wander the Web to build useful archives of web content, such as a search engine’s database or a product catalog for a comparison- shopping robot. See Chapter 9 for more information. Figure 1-14. Tunnels forward data across non-HTTP networks (HTTP/SSL tunnel shown) Figure 1-15. Automated search engine “spiders” are agents, fetching web pages around the world Server Client SSL Tunnelstart SSL HTTP HTTP connection SSL HTTP SSL Tunnelendpoint Port80 SSL connection SSL P o r t 4 4 3 Searchengine “spider” Web server Web server Web server Search engine database
  • 46. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. For More Information | 21 The End of the Beginning That’s it for our quick introduction to HTTP. In this chapter, we highlighted HTTP’s role as a multimedia transport protocol. We outlined how HTTP uses URIs to name multimedia resources on remote servers, we sketched how HTTP request and response messages are used to manipulate multimedia resources on remote servers, and we finished by surveying a few of the web applications that use HTTP. The remaining chapters explain the technical machinery of the HTTP protocol, applications, and resources in much more detail. For More Information Later chapters of this book will explore HTTP in much more detail, but you might find that some of the following sources contain useful background about particular topics we covered in this chapter. HTTP Protocol Information HTTP Pocket Reference Clinton Wong, O’Reilly & Associates, Inc. This little book provides a concise introduction to HTTP and a quick reference to each of the headers and status codes that compose HTTP transactions. http://www.w3.org/Protocols/ This W3C web page contains many great links about the HTTP protocol. http://www.ietf.org/rfc/rfc2616.txt RFC 2616, “Hypertext Transfer Protocol—HTTP/1.1,” is the official specifica- tion for HTTP/1.1, the current version of the HTTP protocol. The specification is a well-written, well-organized, detailed reference for HTTP, but it isn’t ideal for readers who want to learn the underlying concepts and motivations of HTTP or the differences between theory and practice. We hope that this book fills in the underlying concepts, so you can make better use of the specification. http://www.ietf.org/rfc/rfc1945.txt RFC 1945, “Hypertext Transfer Protocol—HTTP/1.0,” is an informational RFC that describes the modern foundation for HTTP. It details the officially sanc- tioned and “best-practice” behavior of web applications at the time the specifica- tion was written. It also contains some useful descriptions about behavior that is deprecated in HTTP/1.1 but still widely implemented by legacy applications. http://www.w3.org/Protocols/HTTP/AsImplemented.html This web page contains a description of the 1991 HTTP/0.9 protocol, which implements only GET requests and has no content typing.
  • 47. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. 22 | Chapter 1: Overview of HTTP Historical Perspective http://www.w3.org/Protocols/WhyHTTP.html This brief web page from 1991, from the author of HTTP, highlights some of the original, minimalist goals of HTTP. http://www.w3.org/History.html “A Little History of the World Wide Web” gives a short but interesting perspec- tive on some of the early goals and foundations of the World Wide Web and HTTP. http://www.w3.org/DesignIssues/Architecture.html “Web Architecture from 50,000 Feet” paints a broad, ambitious view of the World Wide Web and the design principles that affect HTTP and related web technologies. Other World Wide Web Information http://www.w3.org The World Wide Web Consortium (W3C) is the technology steering team for the Web. The W3C develops interoperable technologies (specifications, guide- lines, software, and tools) for the evolving Web. The W3C site is a treasure trove of introductory and detailed documentation about web technologies. http://www.ietf.org/rfc/rfc2396.txt RFC 2396, “Uniform Resource Identifiers (URI): Generic Syntax,” is the detailed reference for URIs and URLs. http://www.ietf.org/rfc/rfc2141.txt RFC 2141, “URN Syntax,” is a 1997 specification describing URN syntax. http://www.ietf.org/rfc/rfc2046.txt RFC 2046, “MIME Part 2: Media Types,” is the second in a suite of five Internet specifications defining the Multipurpose Internet Mail Extensions standard for multimedia content management. http://www.wrec.org/Drafts/draft-ietf-wrec-taxonomy-06.txt This Internet draft, “Internet Web Replication and Caching Taxonomy,” speci- fies standard terminology for web architectural components.
  • 48. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. 23 Chapter 2This is the Title of the Book CHAPTER 2 URLs and Resources Think of the Internet as a giant, expanding city, full of places to see and things to do. You and the other residents and tourists of this booming community would use stan- dard naming conventions for the city’s vast attractions and services. You’d use street addresses for museums, restaurants, and people’s homes. You’d use phone numbers for the fire department, the boss’s secretary, and your mother, who says you don’t call enough. Everything has a standardized name, to help sort out the city’s resources. Books have ISBN numbers, buses have route numbers, bank accounts have account numbers, and people have social security numbers. Tomorrow you will meet your business partners at gate 31 of the airport. Every morning you take a Red-line train and exit at Kendall Square station. And because everyone agreed on standards for these different names, we can easily share the city’s treasures with each other. You can tell the cab driver to take you to 246 McAllister Street, and he’ll know what you mean (even if he takes the long way). Uniform resource locators (URLs) are the standardized names for the Internet’s resources. URLs point to pieces of electronic information, telling you where they are located and how to interact with them. In this chapter, we’ll cover: • URL syntax and what the various URL components mean and do • URL shortcuts that many web clients support, including relative URLs and expandomatic URLs • URL encoding and character rules • Common URL schemes that support a variety of Internet information systems • The future of URLs, including uniform resource names (URNs)—a framework to support objects that move from place to place while retaining stable names
  • 49. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. 24 | Chapter 2: URLs and Resources Navigating the Internet’s Resources URLs are the resource locations that your browser needs to find information. They let people and applications find, use, and share the billions of data resources on the Internet. URLs are the usual human access point to HTTP and other protocols: a person points a browser at a URL and, behind the scenes, the browser sends the appropriate protocol messages to get the resource that the person wants. URLs actually are a subset of a more general class of resource identifier called a uni- form resource identifier, or URI. URIs are a general concept comprised of two main subsets, URLs and URNs. URLs identify resources by describing where resources are located, whereas URNs (which we’ll cover later in this chapter) identify resources by name, regardless of where they currently reside. The HTTP specification uses the more general concept of URIs as its resource identi- fiers; in practice, however, HTTP applications deal only with the URL subset of URIs. Throughout this book, we’ll sometimes refer to URIs and URLs interchange- ably, but we’re almost always talking about URLs. Say you want to fetch the URL http://www.joes-hardware.com/seasonal/index-fall.html: • The first part of the URL (http) is the URL scheme. The scheme tells a web client how to access the resource. In this case, the URL says to use the HTTP protocol. • The second part of the URL (www.joes-hardware.com) is the server location. This tells the web client where the resource is hosted. • The third part of the URL (/seasonal/index-fall.html) is the resource path. The path tells what particular local resource on the server is being requested. See Figure 2-1 for an illustration. URLs can direct you to resources available through protocols other than HTTP. They can point you to any resource on the Internet, from a person’s email account: mailto:president@whitehouse.gov Figure 2-1. How URLs relate to browser, machine, server, and location on the server’s filesystem http://www.joes-hardware.com/seasonal/index-fall.html Client Server Disk Scheme (how) Host (where) Path (what) Webpage index-fall.html
  • 50. This is the Title of the Book, eMatter Edition Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved. Navigating the Internet’s Resources | 25 to files that are available through other protocols, such as the File Transfer Protocol (FTP): ftp://ftp.lots-o-books.com/pub/complete-price-list.xls to movies hosted off of streaming video servers: rtsp://www.joes-hardware.com:554/interview/cto_video URLs provide a way to uniformly name resources. Most URLs have the same “scheme://server location/path” structure. So, for every resource out there and every way to get those resources, you have a single way to name each resource so that any- one can use that name to find it. However, this wasn’t always the case. The Dark Days Before URLs Before the Web and URLs, people relied on a rag-tag assortment of applications to access data distributed throughout the Net. Most people were not lucky enough to have all the right applications or were not savvy and patient enough to use them. Before URLs came along, if you wanted to share the complete-catalog.xls file with a friend, you would have had to say something like this: “Use FTP to connect to ftp. joes-hardware.com. Log in as anonymous. Then type your username as the password. Change to the pub directory. Switch to binary mode. Now download the file named complete-catalog.xls to your local filesystem and view it there.” Today, browsers such as Netscape Navigator and Microsoft Internet Explorer bun- dle much of this functionality into one convenient package. Using URLs, these appli- cations are able to access many resources in a uniform way, through one interface. Instead of the complicated instructions above, you could just say “Point your browser at ftp://ftp.lots-o-books.com/pub/complete-catalog.xls.” URLs have provided a means for applications to be aware of how to access a resource. In fact, many users are probably unaware of the protocols and access meth- ods their browsers use to get the resources they are requesting. With web browsers, you no longer need a news reader to read Internet news or an FTP client to access files on FTP servers. You don’t need an electronic mail program to send and receive email messages. URLs have helped to simplify the online world, by allowing the browser to be smart about how to access and handle resources.* Applications can use URLs to simplify access to information. URLs give you and your browser all you need to find a piece of information. They define the particular resource you want, where it is located, and how to get it. * Browsers often use other applications to handle specific resources. For example, Internet Explorer launches an email application to handle URLs that identify email resources.
  • 51. Another Random Scribd Document with Unrelated Content
  • 52. Neppure in quest'anno andò esente il regno di Napoli dalle dure pensioni della discordia, a cagion della guerra continuata fra i due re, cioè fra Alfonso re d'Aragona e Renato d'Angiò. Povero era Renato, e, mancandogli gente e pecunia [Giornal. Napolet., tom. 21 Rer. Ital.], cioè i due maggiori requisiti a fare e sostenere la guerra, altra speranza non avea se non in Antonio Caldora duca di Bari. Ma questi a quanti messi gli mandava il re, affinchè cavalcasse in suo aiuto, adduceva per iscusa la mancanza del danaro, e il timore che in sua lontananza si ribellassero i popoli dell'Abbruzzo. Prese Renato allora l'ardita risoluzione di portarsi incognito in persona in quelle contrade, e l'eseguì con maraviglia d'ognuno. Raccolse in esso viaggio donativi, danaro e gente, e massimamente dagli Aquilani. Trovavasi egli nel dì 29 di giugno in faccia all'esercito aragonese, e mandò ad Alfonso la disfida della battaglia. La risposta dell'Aragonese fu, che, trovandosi egli padrone della maggior parte del regno, non si sentiva voglia di mettere a repentaglio tutta la sua fortuna in una giornata. Avrebbe nondimeno Renato assalito il campo nemico, e probabilmente con isperanza di vincerlo, perchè già si ritirava; ma l'infedele Caldora co' suoi ricusò di muoversi. Per questo esacerbato Renato il fece ritenere, e prese al suo soldo buona parte delle di lui milizie, lasciandolo poscia tornare in Abbruzzo con titolo di vicerè. Ma in vece di tornar colà il Caldora, cominciò a trattare accordo col re Alfonso. Dio punì la sua infedeltà, perchè in questo mentre Gian- Antonio Orsino principe di Taranto, già tornato alla divozione del re Alfonso, tenne trattato con Marino da Norcia governatore di Bari pel Caldora, ed entrò in possesso non solo di quella città, ma anche di Conversano e di tutte le altre terre dei Caldoreschi. Tornò poscia il re Alfonso colle sue genti all'assedio di Napoli, e però il re Renato, quantunque avesse ricuperato castello Sant'Ermo, tornò ad essere in disagio come prima, e ricorse a papa Eugenio per aiuto. Fin qui erano state rispettate le città e terre degli Sforzeschi in regno di Napoli, cioè quelle del conte Francesco e de' suoi fratelli. Il re Alfonso, secondo i Giornali di Napoli, le prese nell'anno presente, ancorchè fosse pace tra lui e il conte; e trovolle ricchissime per aver esse goduto finora e profittato della loro neutralità. Erano queste Benevento, Manfredonia, Bitonto ed altre non poche [Istor. Napolit.,
  • 53. tom. 23 Rer. Ital.]: danno grave provenuto al conte Francesco per la sua lontananza, avendo egli perduto il proprio per sostenere l'altrui. Verisimilmente fu questo un sottomano del Visconte, che, per vendicarsi d'esso Sforza, segretamente attizzò contra di lui il re Alfonso. Il Simonetta [Simonetta, Vit. Francisci Sfortiae, lib. 5, tom. 21 Rer. Ital.] differisce sino all'anno 1442 lo spoglio di tali città fatto al conte. In mano d'esso re venne anche la città d'Aversa col sua castello. Sigismondo Malatesta signore di Rimini [Cronica di Ferrara, tom. 24 Rer. Ital.], per interposizione di Niccolò marchese di Ferrara, si ritirò dall'amicizia del duca di Milano, e tornò a quella de' Veneziani: il che fu cagione [Cronica di Rimini, tom. 15 Rer. Ital.] che anche Ravenna e i Polentani facessero lo stesso nel dì 14 d'agosto.
  • 54. Anno di Cristo mccccxli. Indiz. iv. Eugenio IV papa 11. Federigo III re de' Romani 2. Non mancarono affari neppure in quest'anno a papa Eugenio [Raynaldus, Annal. Eccles. Spondanus, in Annal. Eccles. Æneas Sylvius, in Epist.], perciocchè tuttavia lo scismatico concilio di Basilea, benchè composto di poche teste, continuava le sue sessioni, e l'antipapa Felice V, cioè Amedeo di Savoia, nel dì 24 di giugno, festa di san Giovanni Batista, con gran solennità si fece coronare colla pontificia tiara nella città di Basilea, dove fu gran concorso di gente, e creò anche quattro cardinali. E benchè il re Alfonso non lasciasse riconoscere per papa nei suoi regni il suddetto Amedeo, pure andava trattando col concilio di Basilea, siccome sdegnato con papa Eugenio, perchè questi ricusava di dargli l'investitura del regno di Napoli. Anzi nel mese di ottobre, per far paura ad esso pontefice, procurò che i prelati basiliensi inviassero a sè una ambasciata, mostrando ancora di voler ottenere dall'antipapa ciò che il papa gli andava negando. Ora Eugenio, non meno per queste ostilità d'Alfonso, che per le preghiere del re Renato, si volse a raccogliere quanti armati potè, e li spedì in regno di Napoli contra di Alfonso. Prima non di meno che giugnessero tali soccorsi, erano succedute alcune azioni vantaggiose al medesimo re d'Aragona [Giornal. Napol., tom. 21 Rer. Ital.]: cioè, accordatisi con lui i Caldoreschi, aveano inalberate le di lui bandiere. Cassano, Biccari, Caiazza, la Padula ed
  • 55. altre terre erano venute a sua divozione [Istoria di Napoli, tom. 23 Rer. Ital.]. Ora da che il conte Francesco Sforza ebbe ragguaglio della guerra mossa da esso Alfonso alle sue terre del regno di Napoli, inviò colà Cesare Martinengo con Vittore Rangone, e con un grosso corpo di cavalleria, il quale, unitosi con altre soldatesche della Marca, col conte di Celano, con Francesco da San Severino ed altri Napoletani [Simonetta, Vit. Francisci Sfortiae, lib. 6, tom. 21 Rer. Ital.], andò ad opporsi ai progressi del re Alfonso. Si trovava allora esso re all'assedio della città di Troia. Vennero le genti del conte Francesco alle mani con lui nel dì 10 di giugno, e, dopo un crudel fatto d'armi, n'ebbero la peggio con loro vergogna, ma senza gran danno, perchè la maggior parte d'essi fuggendo si salvò nella suddetta città di Troia, di maniera che fu forzato Alfonso dipoi a levarsi col campo di sotto a quella città. Nel seguente luglio Alessandro Sforza, governatore della Marca pel conte Francesco suo fratello, entrò anch'egli nel regno con mille e cinquecento cavalli. Per trattato ebbe il castello di Pescara; poscia all'improvviso arrivò addosso a Raimondo Caldora, che assediava Ortona, e il fece prigione insieme con cinquecento cavalli. Poco mancò che non pigliasse anche Riccio e Giosia di casa Acqua viva. Ebbero questi la fortuna di salvarsi a città di Chieti. Comparve poscia nel regno l'esercito pontifizio sotto il comando del cardinale di Taranto legato, e del conte di Tagliacozzo, consistente in circa dieci mila persone; ma non fece prodezza alcuna degna di menzione. Anzi il cardinale da lì a qualche tempo fece tregua col re Alfonso, e se ne tornò in Campagna di Roma. Questa fu la rovina del re Renato [Bonincontrus, Annal., tom. 21 Rer. Ital.], perchè Alfonso mandò tosto don Ferdinando suo figliuolo con grosso corpo di combattenti a strignere d'assedio di bel nuovo Napoli, città che scarseggiava allora e maggiormente seguitò a scarseggiare di viveri. Avea certamente il papa a forza di danari fatto anche un armamento di alcuni legni in Genova, per inviarli contra d'Alfonso; ma spese malamente la pecunia, avendo mostrato i Genovesi voglia di far molto, con poi far nulla. Per conto della Lombardia, veggendosi Filippo Maria duca di Milano in cattiva positura, per avere non solo perduti gli acquisti
  • 56. fatti, ma parte ancora del suo nella guerra co' Veneziani, avea fin dall'anno antecedente pregato Niccolò Estense marchese di Ferrara ad interporsi per la pace, siccome principe neutrale, e che avea sì buona mano in somiglianti affari [Sanuto, Istor. Venet., tom. 22 Rer. Ital.]. Andò il marchese per tal effetto a Venezia, passò anche a Mantova per trattarne con quel marchese; nè solamente tenne filo di lettere col conte Francesco Sforza, ma, con licenza de' Veneziani, andò anche a trovarlo a Marmirolo. Una gran remora a questo affare era lo stesso conte; laonde per guadagnarlo tornò il duca di Milano ad esibirgli in moglie Bianca, unica naturale sua figlia, che seco portava le speranze di tutta la sua eredità. E perchè non poteva il conte prestar fede a chi più di una volta l'avea dianzi burlato, si trovò il ripiego di mandar Bianca a Ferrara in deposito presso il marchese Niccolò. Fu essa dunque condotta a Ferrara, dove come gran principessa fece la sua entrata nel dì 26 di settembre [Cronica di Ferrara, tom. 24 Rer. Ital.] sotto baldacchino di panno d'oro, e stelle poi ad aspettare l'esito di sua ventura. Non so ben dire se per difetto del duca, principe incostante nelle sue risoluzioni, e che per la venuta di Niccolò Piccinino tornò ad alzare il capo, oppure per le pretensioni de' Veneziani, vogliosi di qualche buon boccone, anche in questa occasione andasse a terra la pratica della pace. Certo è che nel verno di quest'anno si ricominciò la guerra, e del dì 5 d'aprile il marchese Niccolò ricondusse Bianca a Milano, dopo aver perduta ogni speranza di comporre le cose. Era già tornato nell'anno precedente a Milano il suddetto Piccinino, ma quasi in farsetto; i suoi soldati veterani il seguitarono quasi tutti a piedi, perchè ogni lor sostanza avean perduto nella rotta d'Anghiari, essendo, come si è detto altrove, secondo la disciplina militare degl'Italiani d'allora, in uso di spogliar d'armi i soldati presi, e di lasciarli andare, con ritener solamente le persone da taglia [Cristoforo da Soldo, Ist. Bresciana, tom. 21 Rer. Ital.]. Ancorchè la borsa del duca fosse estenuata affatto, pure si trovarono gravezze e maniere di spremere quelle dei particolari, tanto che il Piccinino si rimise in arnese, ed incoraggì il duca a nuove militari imprese. Eccolo dunque in campagna nel dì 13 di febbraio dell'anno presente passare il fiume Oglio con circa otto mila cavalli, e tre mila fanti. Questo passaggio mise il terrore nelle milizie venete,
  • 57. che svernavano nel Bresciano, e tutte si ritirarono alle fortezze [Simonetta, Vit. Francis. Sfortiae, tom. eod.]. Mille cavalli del conte Francesco si ridussero a Chiari. Fu loro addosso il Piccinino, e li prese insieme colla terra; e ritenuti i capi di squadra, lasciò andare il resto in bel giuppone. Non passò gran tempo che ricuperò tutta la Geradadda, prese Palazzuolo, tutta la valle d'Iseo, il piano del Bergamasco e gran parte del Bresciano: tanta era la sua velocità in simili azioni. Minutamente si veggono narrati questi fatti da Cristoforo da Soldo, storico bresciano. Solamente nel mese di giugno uscì in campagna Francesco Sforza, e passò sul Bresciano in cerca del Piccinino. Nel dì 25 d'esso mese seguì fra le sue genti e quelle d'esso Piccinino un incontro assai caldo, colla peggio degli Sforzeschi; e da lì innanzi andarono poi girando e come giocando le armate, senza volontà di provar la loro fortuna. Il motivo era, perchè si trattava forte di pace in segreto, e il conte Francesco, che onoratamente comunicava tutte le proposizioni ai commessarii veneziani, era il principale in questo dibattimento. Ciò che diede impulso a ripigliarne il trattato, fu l'insolenza de' capitani del duca di Milano, i quali, mirando esso duca già avanzato in età, e senza figliuoli maschi, tutti d'accordo pensavano ad assicurar la loro fortuna con chiedergli qualche porzione dello Stato di lui. Faceva istanza il Piccinino par avere Piacenza in sua parte; Lodovico da San Severino per Novara; Lodovico dal Verme per Tortona; Taliano Furlano dimandava il Bosco e Fragaruolo nel distretto d'Alessandria. Dispiacque talmente questa sinfonia al duca, che, chiamato a sè Antonio Guidobuono da Tortona suo uomo fidato, ed amico ancora del conte Francesco Sforza, segretamente il mandò a far proposizioni d'accordo ad esso conte, offerendogli la figliuola Bianca, e la città di Cremona con Pontremoli in dote, e con altre esibizioni per appagar anche i Veneziani e Fiorentini. Andò tanto innanzi questa pratica, che, essendo conchiusi i principali articoli [Sanuto, Istor. di Venezia, tom. 22 Rer. Ital. Cristoforo da Soldo, Istor. Bresc., tom. 21 Rer. Ital.], nel dì primo d'agosto, mentre il conte Francesco assediava e batteva colle bombarde Martinengo, dove s'erano chiusi circa mille dei migliori cavalli del Piccinino, all'improvviso saltò fuori
  • 58. la tregua fra le parti guerreggianti, e cessò quell'assedio. Nel 3 d'esso mese Niccolò Piccinino, che coll'esercito suo era accampato in que' contorni, con tutti i suoi uffiziali andò a visitare il conte Francesco. Allora si abbracciarono e baciarono questi due gran capitani, e il conte, oltre all'onore e alle carezze che fece a tutti quei condottieri d'armi, perdonò anche a Taliano Furlano, che piagnendo gli dimandò perdono. Eletto dalle parti arbitro per conchiudere la suddetta pace, esso conte portossi alla Cauriana sul Mantovano, dove si raunarono ancora gli ambasciatori del papa, de' Veneziani e Fiorentini, del duca di Milano, e de' marchesi di Ferrara e di Mantova. Fra le condizioni accordate dal duca vi fu il matrimonio di Bianca sua figliuola, in età allora di sedici anni, col conte Francesco; e però prima di pubblicar la pace andò egli nel dì 25 d'ottobre [Chron. Placent., tom. 20 Rer. Ital. Cronica di Rimini, tom. 15 Rer. Ital.] (il Simonetta [Simonetta, Vit. Francisci Sfortiae, tom. 21 Rer. Ital.] dice il dì 24) con due mila cavalli presso a Cremona; e giunta colà anche Bianca con gran compagnia, la sposò in San Sigismondo, e prese il possesso di Cremona; per le quali nozze si fece mirabil festa in quella città con bagordi, giostre ed altre allegrie [Annales Forolivienses, tom. 22 Rer. Ital. Platina, Istor. di Mantova, lib. 5.]. Fu poi nel dì 20 di novembre pubblicata la pace, in cui Gian- Francesco marchese di Mantova, secondo la disgrazia de' più debili nelle leghe, lasciò il pelo, avendo dovuto restituire a' Veneziani Porto, Legnago, Nogarola, ed altri luoghi da lui presi, e rimettervi del proprio Valeggio, Asola, Lunato e Peschiera, a lui tolti da' Veneziani. Grande allegrezza fu quella di tutta Lombardia per questa pace. Mutazione accadde nell'anno presente in Ravenna [Rubeus, Hist. Ravenn., lib. 7. Cronica di Ferrara, tom. 24 Rer. Ital.]. Vi era signore Ostasio da Polenta, che col suo governo parea andare a caccia delle maniere di farsi odiare da' sudditi suoi. Se l'intesero questi col senato veneto, il quale chiamò a Venezia esso Ostasio colla moglie e col figliuolo, mostrando di voler far loro grande onore. Venne egli a Ferrara, e quantunque il marchese Niccolò il consigliasse di non andare, volle proseguire il suo viaggio. Giunto ch'egli fu colà, il popolo di Ravenna, dato di piglio all'armi nel dì 24 di febbraio, si suggettò a' Veneziani, che presero il dominio e possesso di quella città. Ostasio fu inviato in
  • 59. Candia, dove trovò non men egli che il figliuolo la morte col tempo: con che in esso mancò la nobil famiglia, o almen la signoria de' Polentani, che da lungo tempo dominarono in Ravenna. A papa Eugenio dispiacque non poco di veder passare quella sua città in mani sì potenti. Talmente s'era in questi tempi affezionato il duca di Milano a Niccolò Estense marchese di Ferrara, principe di sommo credito, che, chiamatolo a Milano, non solo si cominciò a reggere col suo consiglio, ma in certa guisa depositò in lui il governo de' suoi Stati. Corse anche voce che meditasse di farlo suo successore dopo la sua morte. Tanta parzialità del duca gli tirò tosto addosso l'invidia di chi era solito a comandare in quella corte, e di chi già pensava a veder succedere in quel ducato il conte Francesco Sforza. Cadde egli infermo nel dì 26 di dicembre, e in poche ore, con fama di veleno a lui dato, si sbrigò da questo mondo, con essere poi portato a Ferrara il cadavere suo, e datagli sepoltura nel dì primo dei seguente gennaio. Lionello suo figliuolo bastardo, ancorchè vi fossero Ercole e Sigismondo suoi figliuoli legittimi, a lui nati da Ricciarda figlia del marchese di Saluzzo, ma allora piccioli di età, per disposizione del padre e del papa, succedette nei dominio di Ferrara, Modena, Reggio, Rovigo e Comacchio. Fu anche guerra in quest'anno [Cronica di Rimini, tom. 20 Rer. Ital.] fra Sigismondo Pandolfo de' Malatesti signore di Rimini e il conte d'Urbino; ma per opera di Alessandro Sforza, fratello del conte Francesco, seguì pace fra loro. E nel mese di agosto i Sanesi [Chronic. Senense, tom. eod.] ebbero gravi molestie da Simonetta capitano di papa Eugenio; ma in fine lo sconfissero, e il fecero fuggire ferito alla di lui patria. I Veneziani dopo la pace cassarono gran copia delle lor soldatesche; e il bello fu, che quante ne potè tirar dalla sua il Piccinino, tutte le prese al suo soldo, ossia a quello del duca di Milano.
  • 60. Anno di Cristo mccccxlii. Indizione v. Eugenio IV papa 12. Federigo III re de' Romani 3. Già si godeva buona quiete in Lombardia, e la guerra tutta s'era ridotta nel regno di Napoli, dove la capitale, stretta d'assedio da Alfonso re d'Aragona, era valorosamente, ma con gran disagio, difesa dal re Renato d'Angiò e dai Napoletani, che molto lo amavano [Simonetta, Vit. Francisci Sfortiae, lib. 6, tom. 21 Rer. Ital.]. Essendo nulladimeno in grave tracollo gli affari di esso Renato, questi nel verno non lasciò addietro preghiere e promesse al conte Francesco Sforza per condurlo nel regno alla propria difesa. E non trovò in questo molte difficoltà, perchè il conte era amareggiato forte a cagion dell'occupazione delle sue città già fatta dal re Alfonso nel regno. Misesi dunque in punto colle maggiori forze ch'egli potò raunare ed assoldare nei mesi del freddo, ed ebbe fra gli altri unito a' suoi disegni Sigismondo Pandolfo Malatesta signor di Rimini, e genero suo per cagione di Polissena sua figliuola con lui maritala in quest'anno. Mandato innanzi Giovanni suo fratello con parte dell'esercito, gli diede ordine d'unirsi nel regno di Napoli con Antonio Caldora, il quale già s'era partito dalla divozione del re Alfonso. Poscia il conte nel principio di maggio [Sanuto, Istor. Ven., tom. 22 Rer. Ital.] imprese il viaggio anche egli a quella volta col rimanente dell'esercito. Ma mentre egli rivolgea i suoi passi e disegni contra d'un lontano nemico, con bene strana scena trovò di averne un altro
  • 61. assai vicino, a cui non avrebbe mai pensato. Per quanto attesta il Simonetta, dacchè il re Alfonso conobbe i preparamenti dello Sforza contra di lui, si diede a tempestar con calde lettere Filippo Maria duca di Milano, acciocchè ritenesse il conte da quella spedizione. Da questo ancora si può scorgere che irregolar testa fosse quella del duca. Non erano, per così dire, quattro giorni che egli nel valoroso conte si era fatto un genero, e come un figliuolo; eppure non tardò ad operar contra di lui alla peggio, sia perchè gli dispiacesse di vederlo tuttavia protetto da' Veneziani e Fiorentini, ed unito con loro, ovvero che si fosse pentito di un accasamento fatto quasi per forza e suo malgrado. Però questo sì instabile principe suscitò contra del conte papa Eugenio, con rappresentargli d'essere venuto il tempo di ricuperar la Marca, e con offerirgli anche le sue forze sotto il comando del Piccinino. Infatti, fingendo egli di aver licenziato dal suo servigio Niccolò Piccinino, questi nel dì 3 di marzo arrivò con molta gente d'armi a Bologna [Cronica di Bologna, tom. 18 Rer. Ital.], città a lui sottoposta, facendo vista d'andarsene a Perugia patria sua. Fu egli poi dichiarato gonfaloniere della Chiesa romana da papa Eugenio [Bonincontrus, Annal., tom. 21 Rer. Italic.]; e giunto a Todi, posseduta allora dal conte Francesco, con un trattato se ne impadronì. Questa novità fece fermare il conte nella Marca, per accudire ai proprii interessi, e prese con Bianca sua moglie per sua residenza Jesi. Mentre queste cose succedeano, Alfonso re d'Aragona, principe di gran mente e sagacità, e di non minore fortuna, continuava l'assedio della città di Napoli, con averla ridotta a gran penuria di vettovaglie [Giornal. Napol., tom. 22 Rer. Ital. Istor. Napoletana, tom. 23 Rer. Ital. Sanuto, Istor. Ven., tom. 22 Rer. Ital.]. Da due mastri muratori napoletani, che furono presi, gli fu insegnata la maniera d'entrare in Napoli, cioè per quello stesso acquedotto per cui tanti secoli prima Belisario s'era nella città medesima introdotto. Era esso strettissimo; il re Renato vi avea fatto mettere dei cancelli di ferro ed altri ripari, e fattavi fare la guardia; ma non fu continuata quest'ultima cautela. Perciò nel venerdì notte, vegnendo il sabbato, dì 2 di giugno, per quel condotto sotterraneo il re Alfonso spinse, chi dice quaranta, e chi più verisimilmente trecento o quattrocento de' suoi soldati entro la città;
  • 62. e questi fino all'apparir del giorno si tennero nascosi in una casa. Fatto giorno, ordinò il re che si desse un fiero assalto alle mura di Napoli alla parte opposta: nel qual tempo i soldati entrati, impossessatisi d'una porta, v'inalberarono la bandiera aragonese. Nello stesso tempo que' di fuori cominciarono colle scale a salir su per le mura; e quantunque il re Renato come un lione accorresse e facesse molte prodezze per trattenere questo torrente, pure fu in fine forzato a ritirarsi, per timore d'essere preso, in Castello Nuovo. Entrati dunque gli Aragonesi, per quattro ore diedero il sacco alla città, finchè arrivato anche Alfonso, mandò bando, pena la vita, che desistessero dalle offese. Grandi carezze fece ai Napoletani, e la città s'empiè in breve di vettovaglia. Giunsero in quel tempo due navi genovesi [Bonincontrus, Annal., tom. 21 Rer. Ital.], che misero provvisioni in Castello Nuovo; e sopra d'esse imbarcatosi il re Renato, se n'andò a Firenze a raccontar le sue disavventure al papa, e a lamentarsi di lui, perchè avesse impedito al conte Francesco il recargli aiuto. Fu consolato con una bella investitura del regno di Napoli, che veramente venne a tempo al suo bisogno; e però se ne tornò da lì a qualche tempo in Provenza, assai chiarito della volubilità delle cose umane. Seppe ben prevalersi della sua fortuna il re Alfonso. Da lì a pochi giorni si rendè il castello di Capuana, e il Nuovo fu assediato. Nel dì 21 di giugno marciò coll'esercito suo contro ad Antonio Caldora, il quale nel dì 28, unito con Giovanni Sforza fratello del conte, animosamente andò ad attaccar battaglia col re. Se non era esso Caldora tradito da' suoi, forse gli dava una mala giornata; ma restò sbaragliato e preso. Secondo il Simonetta [Simonetta, Vit. Francisci Sfortiae, lib. 6, tom. 21 Rer. Ital.], grave sospetto di tradimento diede il medesimo Antonio. Poscia perchè egli rivelò al re le intelligenze di molti signori del regno col conte Francesco, ebbe salva la vita, e con quattro bicocche a lui concedute in Abbruzzo fu rimesso in libertà, essendo passate le sue genti al servigio di Alfonso. Giovanni Sforza, venuto colà con due mila cavalli, se ne tornò con soli quindici a trovare il conte suo fratello nella Marca. Non finì l'anno che, a riserva di Tropea e di Reggio di Calabria, tutto il regno venne alla divozione del re Alfonso, principe liberale verso gli amici, clemente verso i nemici, e che facea buona giustizia ad ognuno. Ebbe anche le due
  • 63. fortezze di Castello Nuovo e castello Sant'Ermo, de' quali il re Renato volle piuttosto fare mercato con Alfonso, che difenderli senza frutto alcuno. Il papa, stato in addietro sì saldo contra del re Alfonso, dacchè il vide cotanto esaltato, cominciò ad addolcirsi con lui, e forse fin d'allora si diede ad intavolar seco un segreto trattato per abbattere il conte Francesco Sforza, e spogliarlo della marca d'Ancona [Raynaldus, Annal. Eccles.]. Non si ricordava egli più dei servigi a lui prestati da questo insigne capitano di guerra, nè delle investiture a lui date, e confermate nell'anno presente, non credendosi tenuto ad osservar patti stabiliti in danno della Chiesa romana, dovendo valer solamente ciò che le è di utile. Trovò che il conte avea prese alcune terre della stessa Chiesa non comprese nella sua investitura. Era anche mal soddisfatto di lui, e con ragione, se è vero ciò che porta Neri Capponi [Neri Capponi, Comment., tom. 18 Rer. Ital.]; perchè nella pace non gli avea fatto immediatamente restituir Bologna, detenuta dal Piccinino, benchè ciò si dovesse effettuar solamente due anni appresso. Ed intanto il Piccinino non era tenuto reo, anzi era a' servigi del medesimo papa. Per attestato del Poggio [Poggius, Hist., lib. 6.], avea fatto lo Sforza il suo dovere per fargli restituire Bologna, ma il duca non volle. Pubblicò dunque il papa sul principio di agosto una bolla contra di Francesco Sforza, dichiarandolo privato del grado di gonfalonier della Chiesa, ribello e nemico. Dispiacque ciò forte ai Fiorentini e Veneziani, che proteggevano il conte, e i primi diedero anche ordine a Bernardo de Medici di metter pace fra esso conte e il Piccinino [Ammirati, Istor. Fiorent., lib. 22.]: il che si effettuò, con essersi veduti insieme ed abbracciati di nuovo questi due valorosi guerrieri. Ma che? non passò molto che il Piccinino occupò al conte la terra ossia città di Tolentino, e tornò alle ostilità. Il Medici di nuovo s'interpose, e racconciò gli affari; ma per poco tempo, perchè appena lo Sforza si fu mosso per passare nel regno contra del re Alfonso, con dare un fiero sacco a Ripa Transona, che il Piccinino alle istanze dei legati del papa gli tolse Gualdo, ed imprese dipoi l'assedio della città d'Assisi. Alla difesa vi fu inviato dal conte con della fanteria Alessandro Sforza suo fratello, ma indarno [Blondus, Dec. IV, lib. 1.].
  • 64. L'avventura o disavventura stessa che dianzi provò Napoli, tornò a vedersi sotto Assisi. Cioè per un acquedotto, insegnatogli da un frate, il Piccinino una notte introdusse entro quella città un migliaio di fanti, colle spalle de' quali anche il resto delle sue genti v'entrò nel dì 30 di novembre [Annal. Foroliviens., tom. 22 Rer. Ital.]. Fu posta a sacco tutta l'infelice città, nè si lasciò indietro iniquità che non fosse commessa, senza neppure portare rispetto alcuno al venerabil tempio di San Francesco. Gran discredito venne a Niccolò Piccinino per questa barbarie, aggiunta all'aver due volte rotti i patti e giuramenti della pace fatta col conte. Ne' medesimi tempi il re Alfonso finì di prendere tutte le terre spettanti nel regno ad esso conte, e furono, secondo l'asserzione del Simonetta [Simonetta, Vit. Francisci Sfortiae, tom. 21 Rer. Ital.], Ariano, Manfredonia, Troia e Monte Sant'Angelo. Mandò bensì il conte Francesco uno de' suoi primi uffiziali, cioè Troilo, al re, per trattar d'accordo; ma Alfonso l'andò menando a spasso con belle parole, senza mai voler conchiudere cosa alcuna; anzi indusse con vantaggiose promesse Troilo stesso ad abbandonare il servigio del conte: il che, siccome vedremo, fu eseguito a suo tempo. Intanto, se crediamo al Sanuto [Sanuto, Istor. Venet., tom. 22 Rer. Ital.], nel dì 16 d'ottobre fu conchiusa una lega fra esso re Alfonso, il duca di Milano e Niccolò Piccinino contro la lega de' Veneziani, Fiorentini e conte Francesco. Fin qui avea Tommaso da Campofregoso doge di Genova lodevolmente governata quella città [Giustiniani, Istoria di Genova, lib. 5.]; ma essendo mancato di vita in quest'anno Batista suo fratello, ch'era il suo principale appoggio, ed avendo i Genovesi per loro nemici il re Alfonso e il duca di Milano, si manipolò una congiura contra di questo doge. Gian Antonio del Fiesco, che n'era il capo, entrò nella città con una frotta d'armati nella notte precedente al dì 18 di dicembre, e mosse a rumore il popolo. Fatto giorno, perchè Tommaso non si sentiva voglia di cedere, fu dato l'assalto al palazzo ducale, in maniera ch'esso doge si rifugiò nella torre dello Orologio, e si diede poscia a Raffaello Adorno. Furono creati gli anziani e capitani del popolo pel governo della città, la quale tornò ben tosto alla quiete primiera.
  • 65. Anno di Cristo mccccxliii. Indiz. vi. Eugenio IV papa 13. Federigo III re de' Romani 4. Perchè papa Eugenio avea trasferito a Roma il concilio, ed inoltre perchè colla fervente voglia di riacquistare la marca d'Ancona, conoscea che non potea andare d'accordo co' Fiorentini, impegnati in favore del conte Francesco Sforza, determinò di lasciar Firenze per passare a Roma [Hist. Senensis, tom. 20 Rer. Ital.]. Misesi dunque in viaggio nel dì 7 di marzo, e giunse nel dì seguente a Siena, dove immensi onori ricevette da quel popolo. Fermossi in quella città sino al dì 5 di settembre, nel qual tempo venne a tributargli il suo ossequio Niccolò Piccinino gonfaloniere della Chiesa, a cui fu fatto un magnifico incontro. Stando quivi Eugenio, cominciò (seppure non avea cominciato molto prima) a tener pratica di pace e di lega col re Alfonso, per valersi del braccio di lui a cacciar dalla Marca Francesco Sforza. Era Alfonso esperto trafficante ne' suoi politici affari. Nel medesimo tempo avea tenuto trattato col conte Francesco e col Piccinino suo avversario, e finalmente conchiuse con chi più vantaggio gli promettea, cioè col Piccinino. Similmente, nel mentre che maneggiava concordia con papa Eugenio, facea di grandi esibizioni all'antipapa Felice, ossia ad Amedeo, e al concilio di Costanza, affin di ottenere l'investitura del regno di Napoli per sè e per don Ferdinando suo figliuol bastardo, già dichiarato duca di Calabria. Molto ancora a lui prometteva sì di privilegii come di danaro
  • 66. il suddetto Amedeo. Così facea finezze e paura nello stesso tempo non meno al papa che all'antipapa. Finalmente il pontefice Eugenio, dopo aver fatto il ritroso un pezzo, si acconciò con Alfonso, e gli accordò tutto quanto egli seppe dimandare, purchè egli impiegasse le forze sue per liberar la Marca dalle mani del conte Francesco. Nel dì 14 di giugno da Lodovico patriarca d'Aquileia e cardinale furono sottoscritti a nome del papa gli articoli di quella concordia, rapportati con altri atti dal Rinaldi [Raynaldus, Annal. Eccles.]. Partito poi da Siena il papa, arrivò felicemente a Roma nel dì 28 di settembre [Petroni, Hist., tom. 24 Rer. Ital.], e nel dì 13 di ottobre diede principio nel Laterano al concilio. Guidantonio conte di Montefeltro e d'Urbino venne a morte nell'anno presente nel dì 21 di febbraio, e gli succedette, secondo la Cronica di Ferrara [Cronica di Ferrara, tom. eod.], nel dominio il conte Antonio suo figliuolo, oppure, secondo gli Annali di Forlì [Annales Foroliviens., tom. 22 Rer. Ital.], Taddeo parimente chiamato suo figlio. Oddo Antonio egli è appellato, e credo con più fondamento, dall'Ammirati [Ammirati, Istor. di Firenze, lib. 22.] e da altri. Grande novità succedette quest'anno in Bologna [Cronica di Bologna, tom. 18 Rer. Ital.]. Nel precedente era venuto in quella città Francesco Piccinino per governarla a nome di Niccolò suo padre. Essendo infermo, si fece portare a castello San Giovanni, ed accompagnare da Annibale Bentivoglio e da Gasparo ed Achille dei Malvezzi. Giunto là, fece prendere questi tre nobili bolognesi, e mandò Annibale nella rocca di Varano su quel di Parma, Achille nella rocca di Mompiano sul Genovesato, e Gasparo nella rocca di Pellegrino nel Piacentino. Per quante premure facessero i Bolognesi presso il duca di Milano e presso Niccolò Piccinino per la liberazione di questi loro concittadini, altro non ne riportarono che belle parole e promesse. Si mossero perciò segretamente da Bologna due valorosi giovani, cioè Galeazzo e Taddeo de' Marescotti con tre altri amici d'Annibale Bentivoglio per cercare le vie di liberarlo. Giunti alla rocca di Varano, ebbero tal industria e fortuna, che una notte scalarono il muro, e misero le mani addosso al castellano e al suo famiglio; sicchè, entrati nella prigione, e limati i ceppi di Annibale, poterono poi nella notte seguente fuggirsene, menando seco il castellano, finchè furono in salvo. Vennero a Spilamberto sul Modenese, dove dal conte
  • 67. Gherardo Rangone ebbero consiglio ed aiuto; e, mandato innanzi l'avviso della lor venuta nel dì 5 di giugno [Sanuto, Ist. Ven., tom. 22 Rer. Ital.], nella seguente notte furono dai loro amici tirati su per le mura con delle corde. Poscia senza perdere tempo, raunati i lor partigiani, e facendo sonare campana a martello a San Giacomo, col popolo in armi corsero furiosamente al palazzo del pubblico, dove abitava Francesco Piccinino, che indarno fece resistenza colle sue genti d'armi. Entrarono nel palazzo, vi fu preso il medesimo Piccinino colla sua brigata; e diedesi subito principio all'assedio del castello di Galiera, che teneva in freno la città. Accadde che in quel tempo passava il conte Lodovico del Verme pel Bolognese, incamminato alla volta della Marca con molta gente a cavallo e a piedi, per unirsi a Niccolò Piccinino. Per questa novità egli si fermò, ed unito con Guidantonio de' Manfredi signor di Faenza, tenne saldo, e presidiò molte castella del Bolognese, e cominciò guerra colla città. Non tardarono i Bolognesi a spedir messi a Venezia e Firenze per soccorso, e nel dì 6 di luglio fecero lega con quelle due repubbliche. In loro aiuto furono spediti da Venezia il conte Tiberto Brandolino da Forlì e il conte Guido Rangone da Modena, valenti capitani di questi tempi, con mille cavalli e ducento fanti. Anche i Fiorentini v'inviarono Simonetto da Castello di Piero con ottocento cavalli e ducento pedoni. Nel dì 14 d'agosto venuto a Bologna l'avviso che il conte Lodovico del Verme s'era levato dalla Riccardina per passare alla Pieve e a San Giovanni con tre mila cavalli; Annibale de' Bentivogli, messi in armi i Bolognesi, andò a trovarlo a Ponte Polledrano, e con tal furia l'assalì, che, dopo breve combattimento, il mise in rotta. Vi rimasero presi da due mila cavalli, undici capi di squadra e tutto il carriaggio. La miglior arma che adoperarono il Verme e gli altri capitani furono gli speroni. Per questa importante vittoria tornarono alla divozion di Bologna tutte le terre e castella di quel distretto; e nel dì 21 si rendè la cittadella di Galiera, a spianar la quale immediatamente si accinse il popolo. Fu cambiato Francesco Piccinino con Gasparo ed Achille Malvezzi condotti dalle rocche dove erano prigioni. Così tornò in sua libertà la città di Bologna. Grandi poi furono in questo anno le applicazioni del
  • 68. papa e del re Alfonso per togliere la marca d'Ancona al conte Francesco [Giornal. Napolet., tom. 21 Rer. Ital.]. Era già entrato esso re in Napoli su carro trionfale nel dì 26 di febbraio, precedendo tutta la fiorita nobiltà di quel regno. Andato da lì a qualche tempo Niccolò Piccinino a Terracina, oppure a Gaeta, a trovarlo, fu ricevuto con gran distinzione, ed onorato col cognome della casa d'Aragona (avea già quello della casa de' Visconti), e con lui concertò l'impresa della Marca. Aveva il conte Francesco presa e saccheggiata Santa Natolia nel territorio di Camerino, e ricuperato Tolentino; ed allorchè s'avvide del nembo che gli soprastava dalla parte del re d'Aragona e di Napoli, cominciò a sollecitare gli aiuti de' Veneziani e Fiorentini, che tardarono di troppo. Intanto il re, fatta da tutte le parti gran massa di gente d'armi, venne nel mese d'agosto in persona verso Norcia, ed andò ad unirsi con Niccolò Piccinino, il quale, assediando la terra di Visso nell'Umbria, la costrinse alla resa. Se vogliamo prestar fede agli Annali di Forlì [Annal. Foroliv., tom. 22 Rer. Ital.], ascendeva l'armata del re e del Piccinino a trenta mila tra cavalli e fanti. Forze da resistere a sì grosso torrente non avea il conte Francesco [Simonetta, Vit. Francisci Sfortiae, lib. 6, tom. 21 Rer. Ital.]; però, poste buone guarnigioni nelle piazze più importanti (cioè Alessandro suo fratello in Fermo, Giovanni altro suo fratello in Ascoli, Rinaldo Fogliano suo fratello uterino in Cività, Pietro Brunoro in Fabriano, Fioravante da Perugia in Cingoli, Giovanni da Tolentino suo genero in Osimo, Troilo da Rossano in Jesi, e Roberto da San Severino in Rocca Contrada), si ritirò egli con parte del suo esercito a Fano, città ben forte di Sigismondo Malatesta suo genero, per quivi aspettare i sospirati soccorsi de' collegati, coi quali potesse far fronte, occorrendo ai nemici. Ma volle la sua disavventura che, oltre a Manno Barile, il quale sul principio di quest'anno l'avea abbandonato, anche altri suoi principali condottieri di armi in sì grave congiuntura il tradissero. Entrato dunque Alfonso col Piccinino nella Marca, ed inalberate le bandiere della Chiesa, tosto si volsero alla di lui ubbidienza San Severino, Matelica, Tolentino e Macerata. Pietro Brunoro gli diede Fabriano, ed acconciossi con lui [Sanuto, Istor. Venet., tom. 22 Rer. Ital.].
  • 69. Altrettanto fece Troilo, benchè cognato del conte Francesco, dandogli Jesi, e passando al suo servigio colle sue truppe. Con ciò vennero meno al conte Francesco più di due mila dei suoi cavalli, e molte schiere di fanteria, che andarono ad ingrossar maggiormente l'esercito nemico. Poscia anche Cingoli si rendè ad Alfonso, e il popolo d'Osimo, levato a rumore, ebbe forza di spogliare Giovanni da Tolentino ed Antonio Trivulzio col presidio [Cronica di Rimini, tom. 15 Rer. Ital.]. Toscanella ed Acquapendente alzarono anch'esse le insegne della Chiesa. In somma non passò gran tempo che tutta la Marca, a riserva di Fermo, d'Ascoli e di Rocca Contrada, venne in potere del re e del Piccinino, che ne prese il possesso a nome del papa. Sbrigato dalla Marca il re Alfonso, nel dì 12 di settembre venne a mettere il campo alla città di Fano, dove si trovava il conte Francesco con gran gente; ma, conosciuto che poco onore potea guadagnare sotto sì forte città, nel dì 18 se ne tornò indietro, e portò le sue armi contro quella di Fermo, alla cui difesa si trovava Alessandro Sforza con buon presidio. Fu in questa occasione che rimasero puniti dei lor tradimenti Pietro Brunoro e Troilo cognato del conte Francesco [Giornal. Napolet., tom. 22 Rer. Ital.]. Furono intercette, cioè fatte cadere in mano del re, lettere scritte loro da esso Alessandro con ordine d'eseguire quanto era stato ordinato. Confessa il Simonetta [Simonetta, Vit. Francisci Sfortiae, lib. 6, tom. 21 Rer. Ital.], essere stato questo uno stratagemma del medesimo conte Francesco, che scrisse al fratello di così operare, per mettere in diffidenza presso il re que' due condottieri, dai quali egli era stato tradito. E ne seguì l'effetto. Fu dunque costantemente creduto che costoro con intelligenza del conte fossero passati nella regale armata, per poi assassinare il re. E perciò il re, messe in armi le sue truppe, li fece prendere amendue, e legati gl'inviò a Napoli, e di là li mandò in una fortezza del regno di Valenza, dove stettero per dieci anni. Secondo il Simonetta, furono anche spogliate tutte le genti d'armi dei suddetti due; ma l'autore de' Giornali Napoletani vuole che il re le prendesse tutte al suo soldo. Nè è da tacere una curiosa particolarità, di cui non io, ma Cristoforo da Costa negli Elogii delle donne illustri sarà mallevadore. Cioè che Pietro Brunoro da Parma, trovata una fanciulla, per nome Bona, nativa della Valtellina, di spirito non ordinario, seco la conduceva
  • 70. vestita da uomo, con avvezzarla al mestier della guerra. Dappoichè Brunoro fu messo prigione, ella andò a tutti i principi d'Italia e di Francia, e ne portò lettere di raccomandazione al re Alfonso per la liberazione di questo suo padrone, di maniera che egli uscì dalle carceri. Gli procurò essa in oltre una condotta di milizie dai Veneziani coll'assegno annuo di venti mila ducati; per li quali benefizii egli poi la sposò. Militò ella finalmente col marito, fece di molte prodezze, e con esso fu inviata contro i Turchi alla difesa di Negroponte. Quivi terminò i suoi giorni Brunoro, ed ella, tornando in Italia nel 1466, per viaggio ammalatasi, diede fine alla sua vita. Dopo avere il re Alfonso tentato invano Ascoli, e preso Teramo e Civitella con altri luoghi, ch'erano del conte Francesco, menò a quartiere le sue soldatesche nel regno di Napoli. Era intanto restato tra Pesaro e Rimini Niccolò Piccinino insieme con Federigo conte d'Urbino, e con Malatesta signor di Cesena, e facea guerra or qua or là alle terre di Rimini, con ridursi in fine a Monteloro. Intanto in soccorso del conte Francesco arrivarono il conte Guido Rangone, Simonetto, Taddeo marchese di Este ed altri capitani con cavalleria e fanteria, spediti da' Veneziani e Fiorentini. Con sì fatti rinforzi il valoroso conte, menando seco Sigismondo Malatesta signore di Rimini e genero suo (della cui fede si dubitò non poco, allorchè il re Alfonso fu sotto a Fano), andò nel dì 8 di novembre insieme con Alessandro suo fratello e con gli altri capitani a trovare il Piccinino, e fu con lui alle mani, ancorchè il vedesse postato in un sito assai difficile e vantaggioso. Per molte ore durò l'atroce battaglia; e quantunque il Piccinino facesse delle maraviglie, più ne fece il conte Francesco, con dargli una gran rotta, prendere circa due mila cavalli, e tutto il ricchissimo bagaglio de' nemici. Col favor della notte si salvò con pochi esso Piccinino a Monte Ficardo, pieno di confusione e di dolore. Spese poi il conte qualche tempo, per le importune istanze di Sigismondo Malatesta, intorno a Pesaro, signoreggiato allora da Galeazzo Malatesta. Di là passò nella Marca, dove trovò che il Piccinino avea rinforzato di gente le principali città; e però, dopo aver ridotte alla sua divozione alcune poche castella, se n'andò a Fermo, e quivi svernò con parte delle sue milizie. Or mentre
  • 71. queste cose succedeano, e dacchè vide Filippo Maria duca di Milano che gli affari del genero suo, cioè del conte Francesco, andavano alla peggio nella Marca, siccome principe non mai fermo ne' suoi proponimenti, cominciò a pentirsi delle sregolate o balorde sue risoluzioni, e a desiderare ch'egli non perdesse il suo Stato. Perciò nel dì 8 di settembre spedì suoi ambasciatori a Venezia [Sanuto, Istor. Venet., tom. 22 Rer. Ital.] per collegarsi con quella repubblica e co' Fiorentini in favore del conte, e fece anche sapere al re Alfonso di desistere dall'offenderlo. Si maravigliò forte il re di questa inaspettata mutazion di volere del duca; inviò a lui ed anche a Venezia ambasciatori; ma niuna grata risposta ne ricevette. Servirono questi passi del duca, e il trattato di lega fra lui, Venezia e Firenze, a fare [Annal. Foroliviens., tom. eod.] ch'egli poi si ritirasse da Fano, e se ne tornasse nelle sue contrade. Ed intanto nel dì 24 di settembre fu conchiusa la lega suddetta in Venezia, in cui ancora entrò Sigismondo Malatesta signore di Rimini. Elessero in quest'anno a dì 28 di gennaio [Giustiniani, Istor. di Genova, lib. 5.] i Genovesi pacificamente per loro doge Raffaello Adorno, di famiglia altre volte salita a quella dignità.
  • 72. Anno di Cristo mccccxliv. Indiz. vii. Eugenio IV papa 14. Federigo III re de' Romani 5. Trovandosi in Fermo Bianca Visconte moglie del conte Francesco Sforza, quivi nel dì 24 di gennaio diede alla luce un figliuolo [Simonetta, Vit. Francisci Sfortiae, lib. 6, tom. 21 Rer. Italic.]; del qual parto fu immantenente spedita la nuova al duca di Milano, padre di lei, per sapere qual nome si dovesse porre al nato figliuolo. Gli fu posto quello di Galeazzo Maria. Fra le sue disavventure ebbe almeno il conte Francesco questa consolazione. Ma, trovandosi senza danari, spedì per ottenerne Sigismondo Malatesta suo genero a Venezia, e ne ricavò questi buona somma, e la maggior parte ancora ne ritenne per sè a conto delle sue paghe. All'incontro Niccolò Piccinino fu ben rinforzato di gente e danaro dal papa e dal re Alfonso; laonde entrò in campagna per tempo, e cominciò le scorrerie pel territorio di Fermo. Dall'altra parte anche le milizie del re Alfonso ricominciarono la guerra. A Monte Milone si portò il Piccinino, ed, avendo passato il fiume Potenza, fu quivi colto da Ciarpellione, uno de' più valenti condottieri d'armi che si avesse il conte Francesco, e ne riportò una buona pelata colla prigionia di molti de' suoi. Si salvò egli miracolosamente, ritirandosi in una torricella, che rimase intatta, per non avervi fatto mente Ciarpellione. Perchè poi gli venne ordine dal duca di portarsi a Milano, e di fare intanto tregua col conte Francesco, eseguì Niccolò il primo comandamento, ma non già il
  • 73. secondo, avendoglielo impedito il legato del papa. Però, lasciato il comando dell'armata a Francesco Piccinino suo figliuolo, volò in Lombardia. Trovossi intanto il conte Francesco in gravi angustie, perchè Sigismondo Malatesta l'avea tradito con essersi messo in viaggio colle sue truppe, per andare ad unirsi con lui, ma con aver poi trovati de' pretesti per tornarsene a Rimini. Dall'altro canto, se Francesco Piccinino univa la sua armata coll'aragonese, non vedea modo da poter sostenere la città di Fermo contra di tante forze. Ora per impedir siffatta unione con quella gente che avea, prese lo spediente di andare a visitar esso Francesco Piccinino, che s'era ben postato a Monte Olmo. Secondo il Simonetta, era il dì di venerdì 23 d'agosto, quando gli fu a fronte, e colle schiere in battaglia l'assalì. Ma non battono i conti secondo il calendario. Negli Annali di Forlì è scritto che fu il dì 19 d'esso mese [Annal. Foroliviens., tom. 22 Rer. Ital.], e lo stesso vien confermato dalla Cronica di Rimini [Cronica di Rimini, tom. 15 Rer. Ital.], e dal Sanuto [Sanuto, Istor. Ven., tom. 22 Rer. Ital.], che per errore dice di maggio. Nè di ciò si può dubitare, stante una lettera scritta nel medesimo dì 19 d'agosto dal conte Francesco a Bologna, come s'ha dalla Cronica d'essa città [Cronica di Bologna, tom. 18 Rer. Ital.]. In quel conflitto certo è che segni di gran valore diede Francesco Piccinino colle sue squadre; ma egli combatteva con un capitano che in fatti d'armi fu maraviglioso, nè sapea esser vinto. Mentre si combatteva, Alessandro Sforza occupò le tende e il bagaglio de' nemici; poscia seguitò ad incalzarli dal suo canto; nel qual tempo il conte Francesco suo fratello con eguale attenzion ed ardore facea lo stesso dall'altro. In somma restò sbaragliato l'esercito di Francesco Piccinino colla perdita di quasi tre mila cavalli, ed egli col rifugiarsi in una palude cercò di salvarsi, ma da un suo fante tradito fu condotto prigione al conte Francesco. Ebbero fatica a ridursi in salvo il cardinal Domenico Capranica legato del papa, e Malatesta a Cesena. Nel dì seguente Monte Olmo si rendè al conte Francesco, ed ivi fu ritrovata gran copia d'uffiziali e soldati del Piccinino, che vi si erano rifugiati con assai cavalli e robe preziose. Ciò fatto, marciò il vittorioso Sforza a Macerata, e senza fatica se ne impossessò, siccome ancora di San Severino. Cingoli volle aspettar la forza prima di rendersi, e dopo otto giorni se gli sottomise con altri piccioli luoghi. Intanto esso
  • 74. conte fece tentar di pace papa Eugenio, che si trovava allora a Perugia, conturbato non poco per le di lui vittorie, dopo aver fulminate le scomuniche nel precedente maggio contra di lui e di Sigismondo Malatesta. Alle istanze del conte diedero maggior polso gli ambasciatori di Venezia e Firenze, di maniera che l'accordo seguì nel dì 10 d'ottobre, con avere il papa lasciate al medesimo conte in feudo con titolo di marchese tutte le terre da lui possedute e ricuperate prima del dì 15 oppure 18 del mese suddetto. A riserva d'Osimo, Recanati, Fabriano ed Ancona, il resto della Marca ubbidiva ai suoi cenni. Era venuto a Milano Niccolò Piccinino, chiamatovi, come dissi (non si sa bene il motivo) dal duca. Non gli si partiva dal cuore l'affanno per la perdita di Bologna [Corio, Istor. di Milano.], e per la sconfitta a lui data dal conte Francesco Sforza. A questi pensieri, che il laceravano di dentro, si aggiunse l'altra dolorosa nuova non solo della rotta di Francesco suo figliuolo, ma d'esser egli anche caduto prigione nelle mani dell'emulo ossia nemico Sforza. Soccombè in fine alla malinconia, ed, infermatosi, terminò il corso del suo vivere nel dì 15 oppure 16 d'ottobre [Cristoforo da Soldo, Istor. Bresc., tom. 21 Rer. Ital.]: con che mancò uno de' più insigni generali d'armata che s'avesse l'Italia, a cui niun altro si potea anteporre, se non Francesco Sforza. Nelle spedizioni la sua attività e prestezza non ebbe pari; ma egli si prometteva molto della fortuna, e però azzardava bene spesso nelle sue imprese: laddove lo Sforza sempre operava con saviezza, e sapea cedere e temporeggiare, quando lo richiedeva il bisogno, nè temerariamente mai procedeva in ciò che imprendeva. Per la morte del Piccinino sommamente si afflisse il duca Filippo Maria, rimasto privo di sì valente, onorato e fedele capitano; nè potendo far altro, si rivolse a beneficare i di lui figliuoli Francesco e Jacopo, con aver ottenuta la libertà del primo dal conte Francesco, e con chiamarli amendue a Milano. Accadde ancora nell'anno presente [Annal. Foroliviens., tom. 22 Rer. Ital. Cronica di Rimini, tom. 15 Rer. Ital.] la morte di Oddo-Antonio conte di Montefeltro e d'Urbino, personaggio di costumi sfrenati e d'insoffribil lussuria. Per cagione di questi suoi vizii fu egli nella notte del dì 22 di luglio da molti congiurati ucciso, e in
  • 75. luogo suo proclamato signore Federigo suo fratello, e figliuolo bastardo di Guidantonio già conte, ancorchè comunemente creduto fosse figliuolo di Bernardino dalla Carda degli Ubaldini. Questi, essendo ito a Fermo per visitare il conte Francesco, stabilì tosto con esso lui lega difensiva ed offensiva. Venne a morte anche in quest'anno [Cronica di Ferrara, tom. 24 Rer. Ital.], nel dì 8 o pure 24 di settembre, Gian-Francesco da Gonzaga marchese di Mantova, assai invecchiato, ed ebbe per successore Lodovico suo figliuolo. Fu parimente chiamato da Dio a miglior vita nella città dell'Aquila a dì 20 di maggio [Raynaldus, Annal. Eccles.] frate Bernardino da Siena dell'ordine de' Minori, celebre missionario di questi tempi, che per le sue luminose virtù venne poi aggregato al ruolo de' santi. Similmente finì di vivere [Bonincontrus, Annal., tom. 21 Rer. Ital.] Leonardo Aretino, segretario della repubblica fiorentina, uomo celebre allora per la sua letteratura e perizia della lingua greca. Si ammalò nel dì 5 d'aprile [Giornal. Napolet., tom. 21 Rer. Ital.] di sì pericolosa malattia Alfonso re di Aragona e delle Due Sicilie, che corse in fin voce che era morto. Gran bisbiglio e movimento fu nei baroni del regno, di modo tale che guarito il re, ben s'avvide del poco capitale che potea farsi della fede de' regnicoli. Diede egli in questo anno [Istoria Napol., tom. 23 Rer. Ital.] per moglie a don Ferdinando duca di Calabria suo figliuolo Isabella di Chiaramonte, nipote di Gian Antonio Orsino principe di Taranto. Maritò eziandio Maria sua figliuola col marchese Lionello d'Este signor di Ferrara, Modena e Reggio. Fu pertanto spedito Borso d'Este fratello d'esso marchese con due galee veneziane a levar questa principessa che, accompagnata dal principe di Salerno, arrivò a Ferrara nel dì 24 d'aprile [Cronica di Ferrara, tom. 24 Rer. Ital.]. Memorabil fu la magnificenza di queste nozze per la quantità delle feste e dei varii solazzi, che durarono quindici giorni coll'intervento degli ambasciatori di tutti i principi d'Italia. Fece guerra in quest'anno il re Alfonso ad Antonio Santiglia signore di Cotrone, Catanzaro ed altri luoghi in Calabria, e gli tolse tutti quegli Stati. Condiscese anche a far pace coi Genovesi [Giustiniani, Istor. di Genova. Sanuto, Istor. Ven., tom. 22 Rer. Ital.], co' quali era in guerra da gran tempo, e gli obbligò a pagargli ogni anno a titolo di censo un bacile d'argento, con accordar loro varii privilegii.
  • 77. Anno di Cristo mccccxlv. Indiz. viii. Eugenio IV papa 15. Federigo III re de' Romani 6. Fra il duca di Milano e Francesco Sforza suo genero parve nel precedente anno restituita buona armonia, per quanto abbiamo veduto. Ma intervenne accidente che affatto la guastò. Dappoichè mancò, colla morte di Niccolò Piccinino, ad esso duca un raro generale delle sue armi, mise egli il guardo sopra Ciarpellione, cioè sopra il più accreditato capitano che si avesse allora Francesco [Simonetta, Vita Francisci Sfortiae, lib. 6, tom. 21 Rer. Ital.], e segretamente cominciò a trattare con lui, per torlo al conte e farlo venire a Milano. Trapelò questo trattato, e se ne crucciò forte il conte, il quale, fidandosi poco del suocero duca, perchè assai ne conosceva l'umore, temeva anche dei malanni, se lasciava partire chi era stato partecipe di tutti i suoi segreti. Fece pertanto mettere prigione nella fortezza di Fermo Ciarpellione, e processarlo per varie sue iniquità [Cronica di Rimini, tom. 15 Rer. Ital.]. Dopo di che nel dì 29 di novembre dell'antecedente anno il fece impiccare, con ispargere voce d'aver egli macchinato contro la vita del medesimo conte. Altamente si chiamò offeso per questo fatto il duca, e protestò di volersene vendicare. Francesco di tutto informò i Veneziani e Fiorentini, a' quali piacea più di vederlo nemico che amico del suocero. Si partì ancora dall'amicizia di esso conte Sigismondo Malatesta signore di Rimini, tuttochè genero del medesimo. Vagheggiava egli da gran tempo
  • 78. Pesaro e Fossombrone, goduti da Galeazzo Malatesta, cioè da chi era privo di figliuoli; anzi s'era già provato colla forza, ma indarno, d'impadronirsene [Sanuto, Istor. Ven., tom. 22 Rer. Ital. Cronica di Ferrara, tom. 24 Rer. Ital.]. Avvenne che, per interposizione di Federigo conte d'Urbino, vendè Galeazzo al conte Francesco essa città di Pesaro per venti mila fiorini d'oro, con che Alessandro Sforza fratello del conte sposasse Costanza sua nipote, e divenisse padrone di quella città. Fossombrone eziandio fu venduto al conte Federigo per tredici altri mila fiorini. Era già per varii motivi mal soddisfatto lo Sforza di Sigismondo suo genero, uomo anche per altro conto di coscienza guasta; e però senza alcun riguardo verso di lui fece il suo negozio. Che disdegno e rabbia per questo provasse Sigismondo, non si può assai dire. Mosse da lì innanzi cielo e terra contra del conte Francesco, tanto presso il pontefice, quanto presso il re Alfonso e il duca di Milano. Spezialmente questo suo sdegno piacque al duca, per potere valersi di lui contra dello Sforza. Ora Filippo Maria co' suoi maneggi tanto fece, che papa Eugenio IV prese Sigismondo al suo soldo, e facendo sperare coll'aiuto proprio e d'esso signore di Rimini assai facile al papa il riacquistare Bologna, a poco a poco accese il fuoco d'una nuova guerra. Nè penò molto a tirarvi anche il re Alfonso, perchè la città di Teramo s'era data al conte Francesco; e Giosia Acquaviva ed altri del suo regno, ribellatisi a lui, si erano uniti col medesimo conte. Mentre questi concerti di guerra si andavano facendo, uno strepitoso accidente avvenne in Bologna [Cronica di Bologna, tom. 18 Rer. Ital.]. Era in quella città in alta stima Annibale de' Bentivogli, perchè riguardato come glorioso liberatore della sua patria. Ma la invidia, nata, per così dire, col mondo, il facea mirar con occhio bieco da Baldassare da Canedolo, da' Ghiselieri e da alcuni altri cittadini. Andò tanto innanzi questa cieca passione, che costoro determinarono di levargli la vita. Fu invitato il Bentivoglio nel dì 24 di giugno, festa di san Giovanni Batista, da Francesco Ghiselieri, a tenergli un suo figliuolo al sacro fonte. Finita la funzione, ed usciti che furono di chiesa, Baldassare e gli altri congiurati, avventatisi addosso al Bentivoglio, con varie ferite lo stesero morto a terra [Annales Placentini, tom. 20 Rer. Ital.]. Poscia andarono in traccia d'alcuni altri amici di lui, e gli uccisero. Per questa enorme indegnità
  • 79. si levò a rumore tutto il popolo contro i micidiarii; diede il sacco alle lor case e le bruciò. Batista da Canedolo, benchè non intervenuto a quell'orrido fatto, indarno fece resistenza all'infuriato popolo, che trovatolo il tagliò a pezzi [Cronica di Rimini, tom. 15 Rer. Ital.]; e quanti amici de' Canedoli vennero in mano d'esso popolo, rimasero vittima del loro furore. Che tal novità fosse fatta con intelligenza del duca di Milano, si conobbe tosto, perch'egli si dichiarò protettore de' Canedoli, e nel dì 26 di giugno Taliano Furlano capitano d'esso duca, che stanziava in Romagna con mille e cinquecento cavalli e cinquecento fanti ducheschi, entrò tosto nel Bolognese in aiuto de' Canedoli; ma ritrovatili o morti o sbandati, da lì a poco cominciò la guerra al Bolognese, e prese varii luoghi. Altrettanto ancora fecero Luigi da San Severino e Carlo da Gonzaga, altri capitani del medesimo duca. Ora i Fiorentini, siccome collegati de' Bolognesi, nel dì 27 di luglio spedirono in loro aiuto Simonetto con cinquecento cavalli e ducento fanti. Anche i Veneziani inviarono colà Taddeo marchese d'Este con altra gente. S'ingrossarono intanto sempre più le milizie del duca di Milano sul Bolognese, e corsero sino alle porte della città; ma null'altro di considerabile accadde in quelle parti nell'anno presente, fuorchè la presa di alcuni castelli, fra i quali il più importante fu San Giovanni in Persiceto, occupato nel dì 9 di settembre da Luigi da San Severino. Abbiam veduto poco fa rimesso in grazia di papa Eugenio il conte Francesco Sforza, e stabilito accordo fra loro. Pure questo pontefice, quasi che i patti durar dovessero finchè gli tornava a conto il non romperli, appena si vide animato ed assistito dal duca di Milano, che ripigliò le armi contra di lui, e seco fu anche il re Alfonso. Ora il conte [Simonetta, Vit. Francisci Sfortiae, lib. 8, tom. 21 Rer. Ital.], giacchè Sigismondo signor di Rimini s'era dichiarato nemico suo, dopo avere ricevuto da' Fiorentini soccorso di danaro, andò a mettere l'assedio alla ricca terra di Meldola, che gli costò molto tempo e fatica. L'ebbe a forza di armi nel dì 17 oppure 22 di luglio [Annal. Foroliviens., tom. 22 Rer. Ital.], e col sacco, crudelmente ad essa dato, si arricchirono tutti i suoi soldati. Ma nel dì 10 d'agosto [Cronica di Rimini, tom. 15 Rer. Ital.] la città d'Ascoli nella Marca gli si ribellò, e tagliato a pezzi Rinaldo
  • 80. Fogliano, fratello uterino del conte Francesco, si diede al pontefice. Così, per le forti istanze di Sigismondo, comparvero dipoi in suo aiuto Taliano Furlano, Malatesta signor di Cesena ed altri capitani con ischiere numerose di cavalleria e fanteria, che seco si unirono. Finalmente anche il papa e il re Alfonso mandarono le lor genti nella Marca per impadronirsene affatto. In mezzo a questi due fuochi si trovava il conte, e con forze troppo disuguali. Tuttavia, conoscendo in maggior pericolo la Marca, lasciata parte delle sue milizie sotto il comando di Federigo conte d'Urbino, coll'altra marciò colà; e all'arrivo suo si ritirarono tosto Lodovico patriarca di Aquileia cardinale legato del papa, e Giovanni da Ventimiglia generale del re Alfonso. Ed eccoti arrivare in essa Marca anche Taliano, creato generale dal duca di Milano, con Sigismondo Malatesta, con Malatesta signor di Cesena ed altri capitani, che cominciò a strignere dall'una parte lo Sforza, e cercava le vie di unirsi dall'altra alle soldatesche del papa e del re. Intanto nel dì 15 d'ottobre Rocca Contrada, una delle migliori fortezze che si avesse il conte in quelle contrade, ribellatasi, venne in mano di Sigismondo, ossia del pontefice. Il perchè, peggiorando ogni dì più gl'interessi del conte, prese questi il partito di salvar la gente con ridursi di nuovo a Pesaro, dove avea lasciata Bianca Visconte sua moglie. Raccomandate adunque ad Alessandro suo fratello le città di Fermo e di Jesi, che restavano a lui ubbidienti, sen venne sul territorio d'Urbino, da dove col conte Federigo fece guerra a Sigismondo Malatesta, togliendo a lui alcune castella. Ma nel dì 26 di novembre il popolo di Fermo, avendo prese l'armi, ne cacciò il presidio del conte, e si sottomise alle armi del papa; e da lì a qualche tempo si rendè loro anche la rocca appellata il Girofalco venduta da Alessandro Sforza, per non poterla sostenere. Sicchè la sola città di Jesi restò in potere del conte, con essersi perdute tutte le altre terre. Nel dì 12 di marzo di quest'anno passò all'altra vita [Benvenuto da S. Giorgio, Istor. del Monferrato, tom. 23 Rer. Ital.] Gian-Giacomo marchese di Monferrato, e i suoi Stati pervennero al marchese Giovanni suo primogenito. Un altro suo figliuolo appellato Guglielmo, condottier d'armi in questi tempi, era al servigio del duca di Milano.
  • 82. Anno di Cristo mccccxlvi. Indiz. ix. Eugenio IV papa 16. Federigo III re de' Romani 7. Fulminò di nuovo in quest'anno nei mesi di aprile e di luglio le scomuniche papa Eugenio contra del conte Francesco Sforza e di tutti i suoi seguaci [Raynaldus, Annal. Eccl.]. E per vendicarsi de' Fiorentini, che colla profusione di molto danaro cagione erano che esso conte non andasse a gambe levate, intavolò un trattato col re Alfonso per muoverlo contra di loro, siccome poi fece nell'anno seguente. Intanto il conte era confortato da Cosimo de Medici, e da alcuni cardinali e baroni romani a marciare alla volta di Roma coll'armi sue, perchè avrebbe facilmente indotto per forza il pontefice ad un buon accordo [Neri Capponi, Comment., tom. 18 Rer. Ital. Simonetta, Vit. Francisci Sfortiae, lib. 8, tom. 21 Rer. Ital.]. Gli promettevano ancora la ribellione di Todi, Narni e di Orvieto, con altri aderenti. Ma egli pensò a mettersi in viaggio, ed ancorchè si movesse sul fine di maggio per passare colà, ed arrivasse fino a Montefiascone e a Viterbo, pure per mancanza di vettovaglie, e perchè Todi ed Orvieto non corrisposero alle speranze dategli, gli convenne tornare indietro. Intanto il papa si provvide di gente, avendo chiamato in suo aiuto un corpo di quelle del re Alfonso, e Taliano Furlano ed altri condottieri, ch'erano nella Marca. Queste truppe dipoi, tornato che fu indietro il conte Francesco, se ne andarono addosso ad Ancona, città che dianzi avea fatta lega co' Veneziani, per non venir nelle mani del papa, e la
  • 83. 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! ebookultra.com