{"id":26700426,"url":"https://github.com/pulsarblow/weblinking","last_synced_at":"2025-04-13T08:52:50.520Z","repository":{"id":67909762,"uuid":"172602356","full_name":"PulsarBlow/WebLinking","owner":"PulsarBlow","description":":link: A .NET implementation of the Web Linking proposed standard RFC8288","archived":false,"fork":false,"pushed_at":"2022-12-13T19:02:43.000Z","size":179,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-27T11:07:25.274Z","etag":null,"topics":["aspnet-core","dotnet-standard","link-header","rest","rfc-5988","rfc-8288","weblinking"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PulsarBlow.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-25T23:30:52.000Z","updated_at":"2023-12-10T22:18:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"b65253eb-92f6-4429-bf06-a1d7d945a2d8","html_url":"https://github.com/PulsarBlow/WebLinking","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PulsarBlow%2FWebLinking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PulsarBlow%2FWebLinking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PulsarBlow%2FWebLinking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PulsarBlow%2FWebLinking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PulsarBlow","download_url":"https://codeload.github.com/PulsarBlow/WebLinking/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248688543,"owners_count":21145763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aspnet-core","dotnet-standard","link-header","rest","rfc-5988","rfc-8288","weblinking"],"created_at":"2025-03-27T00:28:13.450Z","updated_at":"2025-04-13T08:52:50.513Z","avatar_url":"https://github.com/PulsarBlow.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"WebLinking logo\" src=\"assets/banner-1280x640.png\" /\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003e\n  Web Linking for .NET\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003eA .NET implementation of the Web Linking proposed\nstandard [RFC8288](https://tools.ietf.org/html/rfc8288)\u003c/h4\u003e\n\n[![NuGet](https://img.shields.io/nuget/v/WebLinking.Core.svg)](https://www.nuget.org/packages/WebLinking.Core/) [![net 6.0](https://img.shields.io/badge/net-6.0-brightgreen.svg)](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-6) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/0d75f07b773d406bad11fd33d52f9601)](https://www.codacy.com/gh/PulsarBlow/WebLinking/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=PulsarBlow/WebLinking\u0026amp;utm_campaign=Badge_Grade) [![Codacy Badge](https://app.codacy.com/project/badge/Coverage/0d75f07b773d406bad11fd33d52f9601)](https://www.codacy.com/gh/PulsarBlow/WebLinking/dashboard?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=PulsarBlow/WebLinking\u0026utm_campaign=Badge_Coverage)\n\nThe RFC8288 is a [IETF](https://www.ietf.org/) specification that defines a model for the relationships between resources on the Web (\"links\") and the type of those relationships (\"link relation types\"). It also defines the serialisation of such links in HTTP headers with the `Link` header field.\n\nThis .NET library is a strict implementation of this specification.\n\n---\n\n## Getting Started\n\nThis implementation provides two .NET 6.0 NuGet packages and a sample AspNet Core API.\n\n### WebLinking.Core\n\nThe core implementation of the specification.\\\nProvides Link header format definition and abstractions.\n\nThis library helps you add Web Linking RFC support into your .NET Application.\n\n`dotnet add package WebLinking.Core`\n\n### WebLinking.Integration.AspNetCore\n\nAspNet Core MVC integration layer and abstractions.\n\nThis library helps you integrate Web Linking support into your ASP.NET Core MVC application.\n\n`dotnet add package WebLinking.Integration.AspNetCore`\n\n### WebLinking.Samples.SimpleApi\n\nA sample project to demo how to integrate WebLinking into an AspNetCore Mvc application.\\\nFound in the [samples/simple-api](./samples/simple-api/) directory.\n\nOnce your run this demo api, you can fetch a paginated collection of values.\\\nResponses contains a Link headers containing a set a Web Links to navigate throught the collection.\n\n__Example__\n\n_Request_\n\nWe fetch 10 values, starting from the 10th one.\n\n`GET https://localhost:5001/api/values?offset=10\u0026limit=10`\n\n_Response_\n\nThe API returns the 10 requested values and a set of Links to navigate within the set:\n\n-  `start`: the begining of the collection\n-  `previous`: the previous set of 10 values\n-  `next`: the next set of 10 values\n\n`Link: \u003chttps://localhost:5001/api/values?offset=0\u0026limit=10\u003e; rel=\"start\",\u003chttps://localhost:5001/api/values?offset=0\u0026limit=10\u003e; rel=\"previous\",\u003chttps://localhost:5001/api/values?offset=20\u0026limit=10\u003e; rel=\"next\"`\n\n## What is Web Linking ?\n\nWithout being limited to that, Web Link is often seen as an API pagination mean.\\\nIt is a lightweight alternative to HATOAS, where pagination cursors are embedded in the resource representation.\\\nWith Web Linking, pagination cursors are sent in the header of the HTTP response.\n\nFor example, [Github API v3](https://developer.github.com/v3/#pagination) uses Web Linking to express pagination cursors :\n\n```\nLink: \u003chttps://api.github.com/user/repos?page=3\u0026per_page=100\u003e; rel=\"next\",\n\u003chttps://api.github.com/user/repos?page=50\u0026per_page=100\u003e; rel=\"last\"\n```\n\nAPI Clients don't need to implement link formatting, they just use links returned by the API. It makes them resilient to link format changes over time. The `rel` attribute defines the type of relation this link provides.\n\n### How Web Linking is different from HATOAS ?\n\nBeside specifying the Link format, Web Linking also defines how links should be convey in the HTTP response.\n\nIn opposite to a more traditional HATOAS approach, where Links are conveyed inside the Resource representation, with Web Linking links are conveyed in a Link HTTP header.\n\nThis difference is subtle but it helps producing a lightweight Resource representation.\\\nWhen you need to convey the Link in the response body, you need to wrap your Resource definition into a more verbose structure.\n\nWith Web Linking you can just return a `pure` Resource representation.\n\nHowever, keep in mind that it is a the price of the developer experience. HTTP Headers are less discoverable than HTTP Response body (eg. Browser).\n\n### Web Linking in the industry\n\nWho is using Web Linking ?\n\n-   [Github](https://developer.github.com/v3/#pagination)\n-   [GitLab](https://docs.gitlab.com/ee/api/#pagination-link-header)\n-   [Sentry.io](https://docs.sentry.io/api/pagination/)\n-   [Dribble](http://developer.dribbble.com/v1/#pagination)\n-   [PandaScore](https://developers.pandascore.co/doc/#section/Introduction/Pagination)\n\njust to name of few...\n\n### Implementation notes\n\nThe current proposed standard leave some place for some interpretations. Implementation interpretations are disambiguated in the following points :\n\n-   Multiple identical link relation types\n\n\u003e The rel parameter can, however, contain multiple link relation types.\n\u003e When this occurs, it establishes multiple links that share the same\n\u003e context, target, and target attributes.\n\nNothing is specified concerning multiple identical link relation types.\\\nThus, this implementation does not deduplicate multiple identical link relation types.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpulsarblow%2Fweblinking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpulsarblow%2Fweblinking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpulsarblow%2Fweblinking/lists"}