refit
refit copied to clipboard
[BUG] Fragments/anchors are removed from URL
Describe the bug
I am implementing a Refit client for the Mixpanel API. Many of their API endpoints contain a fragment (aka anchor, hashtag, pound), like this:
My Refit declaration for the above API is:
[Post("/engage#profile-set")]
Task<ApiResponse<int>> SetPropertiesAsync(
[Body(BodySerializationMethod.UrlEncoded)] UserProfileSetRequest request,
CancellationToken ct);
However, when I run this and inspect the underlying HttpRequestMessage
, the #profile-set
part of the URL is missing, and the API call fails.
Expected behavior
URL fragments should be preserved.
Environment
- OS: macOS Monterey 12.0.1
- Device: 2019 Intel MacBook Pro
- Version: 6.1.15