Skip to content

OAuth 1.0 with special chars #2126

Description

@teunlielu

DO NOT USE ISSUES FOR QUESTIONS

Describe the bug
If you use special characters like: éèç you get error authentication fail.

HttpRequestException: Request failed with status code Unauthorized

To Reproduce

Example code was VB convert to C# for faster responce:
Removed code not important to report the bug.
AddParameter or AddqeuryParameter no difference

usingRestSharp;usingRestSharp.Authenticators;usingRestSharp.Authenticators.OAuth;internalstaticpartialclassProgram{privateconststringconsumer_key="*******";privateconststringconsumer_secret="*******";privateconststringaccess_token="*******";privateconststringtoken_secret="*******";privateconststringURL="https://example.com";publicstaticvoidMain(string[]args){varauthenticator=OAuth1Authenticator.ForAccessToken(consumer_key,consumer_secret,access_token,token_secret,OAuthSignatureMethod.HmacSha256);varoptions=newRestClientOptions(){authenticator=authenticator,ThrowOnAnyError=true};RestResponseresponse=default;RestRequestrequest=default;varclient=newRestClient(options);request=newRestRequest(URL,Method.Get);request.AddParameter("filter",@"éèç");request.AddHeader("Content-Type","application/json");response=client.GetAsync(request).Result;Console.WriteLine(response.Content);Console.ReadKey();}}

Expected behavior
Request returns desired search result

Stack trace

Request failed with status code Unauthorized
at RestSharp.RestClient.<ExecuteAsync>d__0.MoveNext()
at RestSharp.RestClientExtensions.<GetAsync>d__14.MoveNext()

Desktop (please complete the following information):

  • OS: [e.g. Windows 10]
  • .NET version [e.g. .NET 6]
  • Server to reqeust Linux server.

Additional context
Add any other context about the problem here.

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions