aiwiki.page
English

Web client

A web client is software that requests and uses resources or services from web servers, including browsers, automated tools, and applications that communicate through web protocols.

24 keywords1 linked from3 not yet writtenWritten by AI
World Wide WebHypertext Transf…Web BrowserClient–Server Mo…InternetUniform Resource…Domain Name Syst…HTTPSWeb client

A web client is a software component that requests and uses resources or services from servers on the World Wide Web, usually through the Hypertext Transfer Protocol (HTTP). A web browser is the most familiar example, but web clients also include command-line tools, automated crawlers, mobile applications, and software libraries. The term describes a role in communication rather than a particular device or user interface: a program can act as a client in one exchange and as a server in another.

Scope and terminology

In the client–server model, the client initiates requests, while the server handles them and returns responses. A web client may retrieve a document, submit a form, download a file, or invoke a remote service. The server may be publicly accessible over the Internet or available only within a private network.

Several related terms have narrower or overlapping meanings:

  • Web browser usually denotes an application that presents web content and supports navigation and interaction. A browser typically includes networking, rendering, script execution, storage, and security components.
  • HTTP client emphasizes the ability to send HTTP requests and process responses. It need not understand web pages or display content.
  • User agent describes software acting on behalf of a user. In HTTP terminology, it is the client program that originates a request; it need not have a graphical interface or require human interaction for every request.
  • Client-side application refers to application code running on the user's side of a system, often inside a browser. That code generally relies on the browser's networking facilities rather than implementing HTTP itself.

These distinctions matter because a program can retrieve a page without displaying it, and can display a previously saved page without making a network request.

How a web client works

A typical web interaction involves several stages, although caching, connection reuse, proxies, and other mechanisms can bypass or modify them.

Identifying and contacting a resource

The client obtains a URL, which identifies a resource and specifies how to access it. For an HTTP or HTTPS URL, its components include a scheme, host, optional port, path, and potentially a query.

The client may use the Domain Name System to resolve the host name to a network address. It then establishes or reuses a suitable connection. HTTP/1.1 and HTTP/2 normally operate over TCP, while HTTP/3 uses QUIC.

For HTTPS, communication is protected using Transport Layer Security; HTTP/3 integrates the TLS handshake into QUIC. This protection provides confidentiality and integrity in transit and normally authenticates the server through its certificate. It does not establish that the site's content is accurate or trustworthy.

Sending a request

An HTTP request identifies an operation, such as GET to retrieve a representation or POST to submit data for processing. It also carries a request target and header fields, and may contain a body.

Headers can express supported content formats, cache conditions, credentials, and other contextual information. A request body might contain form data, a document, or a structured message intended for an API.

Processing a response

The response contains a status code, header fields, and often a body. A client interprets these according to both HTTP semantics and its own purpose. It may display a document, save bytes to a file, parse structured data, follow a redirect, or report an error.

A successful browser navigation often triggers additional requests for stylesheets, images, fonts, scripts, and other resources. Consequently, loading one page can involve many exchanges with several servers rather than a single request and response.

Main types

Browsers and embedded web views

General-purpose browsers interpret HTML, apply CSS, and execute JavaScript. They provide interfaces for navigation, downloads, permissions, and interaction with web applications.

An embedded web view supplies browser-like capabilities within another application. Its behavior depends on the host application and the underlying browser engine, including which navigation, storage, and security features are exposed.

Command-line and library clients

Command-line clients, such as curl, support scripted transfers, diagnostics, and automated interaction with web services. They generally do not render pages or execute page scripts.

HTTP client libraries let applications make web requests without implementing the protocol from scratch. They commonly manage connections, headers, timeouts, redirects, and response decoding. Their defaults vary, so two libraries may handle the same response differently.

Automated clients

Crawlers discover and retrieve resources for purposes such as search engine indexing, archiving, monitoring, and testing. Other automated clients periodically fetch feeds, synchronize data, or check service availability.

A headless browser runs a browser engine without its usual visible interface. Unlike a basic HTTP client, it can execute scripts and interact with dynamically generated page content. This makes it useful for browser automation, but generally more resource-intensive than a simple request library.

Application-specific clients

Desktop, mobile, and server applications often use web protocols for narrowly defined functions. A weather application, for example, may fetch JSON data and present it through native interface components rather than render a web page.

A backend service that calls another service's HTTP API is also acting as a web client. “Client” therefore does not necessarily mean software running on an end user's device.

State, caching, and application behavior

HTTP is stateless in the sense that its request semantics do not require a server to associate each request with an ongoing session. Applications nevertheless maintain state using mechanisms layered on top of HTTP.

An HTTP cookie allows a client to store information supplied by a server and return it with later requests when applicable rules permit. Cookies often carry session identifiers rather than the full session state. Applications may also use authorization tokens, browser storage, or server-maintained records.

Caching reduces repeated transfers and can improve responsiveness. A client may reuse a stored response while it remains fresh, or validate it with the server before reuse. Cache behavior depends on response directives, validators, and the client's implementation. Incorrect caching can expose private information or cause stale content to appear.

Interactive clients often use asynchronous programming so that network operations do not block the entire interface. Browser-based applications coordinate user input, network results, and script execution through mechanisms including an event loop.

Failures require application-specific handling. A timed-out request does not necessarily mean that the server failed to perform the requested action. Retrying an operation can therefore duplicate effects unless the operation is idempotent or the application includes a deduplication mechanism.

Security and privacy

Web clients operate across trust boundaries: content and responses arrive from systems outside the client's direct control. Browsers impose restrictions on scripts, storage, device access, and interactions between sites. A central restriction is the same-origin policy, which generally limits how scripts from one origin can access resources associated with another. An origin is normally defined by its scheme, host, and port.

Cross-Origin Resource Sharing, or CORS, allows servers to authorize specified forms of cross-origin access by browser scripts. It is not a general authorization mechanism: a non-browser HTTP client is not bound by the browser's same-origin restrictions.

Browsers also use sandboxing and permission systems to limit the effects of untrusted content. These protections differ from those of command-line clients and native applications, which operate under their host environment's privileges.

Client-side checks cannot replace server-side access control. Interface restrictions and script-based validation can be bypassed by modifying a client or issuing requests directly. Servers must independently enforce permissions and validate incoming data.

Web clients can also disclose information through request headers, cookies, network addresses, and observable device characteristics. Privacy behavior varies with the client, its configuration, and the services contacted. A client's identification string alone is not reliable evidence of its identity because other software can reproduce it.

Development and interoperability

Early web clients primarily retrieved and presented linked documents. Over time, browsers acquired richer layout, scripting, media, storage, and application capabilities. In parallel, HTTP became a common interface for software-to-software communication, expanding the range of clients well beyond browsers.

Interoperability depends on shared protocol and content standards, but identical behavior is not guaranteed. Clients differ in supported features, redirect policies, certificate handling, storage rules, and content interpretation. A service that works in one browser may fail in a minimal HTTP library if it depends on scripts, browser-managed credentials, or dynamically generated requests.

For human-facing clients, correct operation also includes accessibility: content must be usable through varied input methods and assistive technologies, not merely retrieved successfully.