Skip to content

[Bug]: URL Segments getting encoded, with seemingly no way to toggle this #2002

Description

@phinett

Describe the bug 🐞

s there any way to stop Refit url encoding my URL segments, i'm using a Zoho API and it doesn't like it when it gets encoded.
Example:

[Post("/{prevCalendarId}/events/{**eventId}?destinationcaluid={destinationCalendarId}")]
    Task<CalendarEvent> MoveEventToNewCalendar(string prevCalendarId, 
       string eventId, string destinationCalendarId);

The eventId is passed as something like [email protected], but the @ symbol is being encoded, to something like this:

/api/v1/calendars/9000000001ea4a9287a548f28ca330b0/events/3bf00000000488fda0ec154ee%40zoho.com?destinationcaluid=10e03c34110f402dbf8368e500asdas0

I have seen various options to stop it encoding Query strings, but not the actual URL segments like above.

Step to reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Reproduction repository

https://github.com/reactiveui/refit

Expected behavior

This should happen...

Screenshots 🖼️

No response

IDE

No response

Operating system

No response

Version

No response

Device

No response

Refit Version

No response

Additional information ℹ️

No response

Activity

  1. added
    🟠 priority: mediumReal bug in a narrower scenario, or a commonly-requested feature
    🔗 area: url-routingURL building, path/query params, segments, collection format
    on Jun 16, 2026
  2. glennawatson commented on Jul 15, 2026

    @glennawatson
    Contributor

    This is addressed in the Refit 14 beta, now available on NuGet: https://www.nuget.org/packages/Refit/14.0.0-beta.1

    Please give it a try - feedback ahead of the stable 14.0.0 release is very welcome.

    Type-safe REST API clients for .NET, generated from annotated interfaces with build-time source generation, direct request construction, System.Text.Json defaults, and support for trimming and AOT.
  3. github-actions commented on Jul 30, 2026

    @github-actions

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  4. locked as resolved and limited conversation to collaborators on Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bug🔗 area: url-routingURL building, path/query params, segments, collection format🟠 priority: mediumReal bug in a narrower scenario, or a commonly-requested feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions