| title | README Uri Template, NuGet API |
|---|---|
| description | The README uri template allows clients to download the readme for a package, if available. |
| author | jgonz120 |
| ms.author | jongonza |
| ms.date | 1/6/2025 |
| ms.topic | reference |
| ms.reviewer |
It is possible for a client to build a URL that can be used to download a README for a specific package. This will enable the clients to render the package's README without downloading the entire package.
The resource used for building this URL is the ReadmeUriTemplate resource found in the
service index.
The following @type values are used:
| @type value | Notes |
|---|---|
| ReadmeUriTemplate/6.13.0 | The initial release |
The URL for the following API is the value of the @id property associated with one of the aforementioned
resource @type values.
The constructed URL must support the HTTP method GET
Given a known package ID and version, the client implementation can construct a URL to download the README.
The value of the @id is a URL string containing any of the following placeholder tokens:
| Name | Type | Required | Notes |
|---|---|---|---|
{lower_id} |
string | yes | The package ID, lowercased |
{lower_version} |
string | yes | The package version, lowercased |
Both lower_id and lower_version are lowercased using the rules implemented by .NET's
System.String.ToLowerInvariant()
method.
The lower_version is the desired package version normalized using NuGet's version
normalization rules. This means that build metadata
that is allowed by the SemVer 2.0.0 specification must be excluded in this case.
If the package has a readme, a 200 status code is returned. The response body will be the readme content itself.
If the package does not have a readme, a 404 status code is returned.