-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
“path” parameters are URL encoded differently in Java than in C# #151
Comments
I can't reproduce this behavior with .NET Core 2.0 on my Mac. When I generate the C# client with: [email protected]/autorest.csharp@latest and pass a URL parameter like Will follow up after I try to repro on my PC. |
I also see It's not likely we'll support this unless I can find someone on the C# side who can tell me they definitely are skipping encoding @shahabhijeet do you know what the expected behavior of URL encoding '/' with the C# runtime is? |
I made a mistake, and both C# and Java are incorrectly encoding |
I've been looking around to try and make sure of what the spec is supposed to be. It appears that by default we need to escape slashes in path params. It sounds like C# and Java are doing this. Feel free to follow up with any suggestions if "x-ms-skip-url-encoding" is not enough to address your use case. |
Sorry, what I said in my previous post is incorrect. Although C# uses System.Uri.EscapeDataString to escape path parameters, and the |
It would be of great help to us if you could provide a sample project which reproduces the C# runtime behavior you describe. |
If you want to skip URL encoding for a path parameter, please use If this is still an issue with |
Using AutoRest 2.0.4245, I noticed that “path” parameters are URL encoded differently in Java than in C# (Swagger below). In Java, “dir/file” is encoded as “dir%2Ffile”. In C#, it is encoded as “dir/file”. I like the way C# encodes paths and would like URL encoding to be consistent across the languages.
The text was updated successfully, but these errors were encountered: