Conversation
Adds a new static method Http.ParseLinkHeader that parses the 'Link' response header (RFC 5988) into a Map<string, string> from relation type to URL. This is useful for consuming paginated REST APIs such as GitHub, GitLab, etc. that use Link headers to provide next/prev/last page URLs. Also adds documentation in Http.fsx showing a complete pagination example using JsonProvider and ParseLinkHeader together. Closes #805 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4 tasks
dsyme
approved these changes
Feb 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Adds
Http.ParseLinkHeader, a small utility that parses an RFC 5988Linkresponse header into aMap(string, string)from relation type to URL.What's changed
Http.ParseLinkHeader(linkHeader: string) → Map(string, string)— parses aLinkheader such as:into
Map [ "next", "(redacted)"; "last", "(redacted)" ]Documentation — added a "Paginated APIs (RFC 5988 Link headers)" section to
docs/library/Http.fsxwith a complete example showing how to walk through a paginated JSON API usingJsonProvider+ParseLinkHeader4 unit tests covering empty header, single relation, next/last, and first/prev/next/last
Motivation
Many REST APIs (GitHub, GitLab, npm, etc.) use RFC 5988
Linkheaders for pagination. FSharp.Data already hasHttpResponseHeaders.Linkas a constant, but no utility to parse the value. This ~15-line addition closes the gap and lets users compose pagination themselves without bringing in additional dependencies.Closes
Closes #805
Test Status
4 new unit tests pass; 11/11 total
ParseLinkHeader/AppendQueryToUrltests pass (run withdotnet test --filter ParseLinkHeader|AppendQueryToUrl).