Java HttpURLConnection user agent
HttpURLConnection is the HTTP client built into the Java standard library. When code uses it without setting a custom header, it sends a default user agent that names the Java runtime. Seeing that token marks a request as scripted JVM traffic from plain standard-library code rather than a browser or a higher-level client.
What this means
HttpURLConnection ships with the Java platform, so a lot of older or dependency-light JVM code uses it for outbound HTTP without pulling in a third-party library. When the caller does not set a User-Agent header, the runtime supplies a default that names the Java version.
This is distinct from higher-level clients such as OkHttp or Apache HttpClient, which have their own defaults. A bare Java-runtime token usually means the standard-library client was used directly.
How it appears
Look for a Java product token with a version and no browser compatibility chain — no AppleWebKit, Gecko, or Chrome tokens. That absence is a strong hint the caller is a library rather than a browser.
Because setting a custom header is trivial, many production callers replace the default. Match the Java default to catch unconfigured clients, but do not assume its absence means no HttpURLConnection traffic.
- Built into the Java standard library
- Default user agent names the Java runtime version
- Distinct from OkHttp / Apache HttpClient; easily overridden
How it appears in analytics and logs
A user agent naming the Java runtime indicates a JVM program using the built-in HttpURLConnection directly. It is automation — an integration, job, or scraper — not a human page view.
Diagnostic use case
Identify scripted traffic from Java's standard-library HTTP client, distinguish it from higher-level clients like OkHttp, and recognise that the default is often overridden.
What WebmasterID can help detect
WebmasterID classifies the Java standard-library default as scripted, non-browser traffic, helping keep plain JVM HTTP calls separate from human analytics.
Common mistakes
- Assuming all JVM HTTP traffic shows the Java default token.
- Confusing the standard-library client with OkHttp or Apache HttpClient.
- Counting Java HttpURLConnection calls as human page views.
Privacy and accuracy notes
The Java token identifies the runtime making the request, not a person. WebmasterID reads it as a coarse automation signal only.
Related pages
- Java and OkHttp user agents
JVM HTTP clients send recognisable default user agents: Java's built-in URL connection uses a Java/version token, and the widely used OkHttp library uses an okhttp/version token. Both mark scripted or app traffic from the Java ecosystem, including many Android apps. This page covers the two patterns.
- Apache HttpClient user agent
Apache HttpClient, part of the Apache HttpComponents project, is a widely used Java HTTP client. Its default user agent contains an Apache-HttpClient token with a version. It is one of several common Java HTTP clients (alongside OkHttp and the JDK's own client) and marks server-side automation, not a browser.
- API client user agents (Postman, etc.)
Developers exercise APIs with tools like Postman, Insomnia, and HTTPie, each of which sends a recognisable default user agent (for example a PostmanRuntime token). Seeing these means someone is testing or scripting against your API, not browsing your pages. This page covers the patterns and how to read them.
- Bot intelligence
Surface Java standard-library HTTP traffic separately from human visits.
Sources and verification notes
- Java Platform — HttpURLConnection (Oracle docs)Standard-library HTTP client; runtime supplies a Java-named default user agent when none is set.
Last reviewed 2026-06-24. Facts are checked against primary/official sources where available; uncertain specifics are marked “Data not yet verified” rather than guessed.