Share via

utf8 problem in webapplication

linky 21 Reputation points
2021-01-04T06:09:16.353+00:00

Hi I Have WPF Project and use restsharp dll for connect to my site database, But the result is not correct and show me the something like «U0636/U062C»
I use this code, But that not work. how can I fix this? please help me

  var client = new RestClient("My URL");

        client.UseUtf8Json();
        var request = new RestRequest(Method.POST);
        request.AddHeader("token", "MyToken");
        request.AddHeader("Content-Type", "application/x-www-form-urlencoded; charset=Utf8");
        request.AddHeader("Cookie", "PHPSESSID=sadasdsadwedasd");

        request.AddParameter("application/json", "{\r\n    \"name\":\"test\",\r\n    \"password\":\"asdasdasd\"\r\n}", ParameterType.RequestBody);

        IRestResponse response = client.Execute(request);

        MessageBox.Show(response.Content);
Developer technologies | Windows Presentation Foundation

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.