refit icon indicating copy to clipboard operation
refit copied to clipboard

[BUG] Fragments/anchors are removed from URL

Open bourquep opened this issue 3 years ago • 0 comments

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:

CleanShot 2021-12-01 at 08 16 16@2x

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

bourquep avatar Dec 01 '21 13:12 bourquep