I have this c# method
public void TestMethod1()
{
string login = @"partone\afif@gmail.com" ;
string pwd = "ksLLHddf5El";
var request = new RestRequest("https://secureapp4.idshost.fr/authenticationids/restloginservice.php", Method.POST);
request.RequestFormat = DataFormat.Json;
request.AddHeader("Content-type", "application/json;charset=utf-8");
request.AddBody(new { authentifier = login, password = pwd });
RestClient client = new RestClient();
var response = client.Execute(request);
var data = response.Content;
}
The problem is the special character \
in the login string, it generates invalid authentifier
parameter.
So I need to know how can I fix this?
The problem is likely to do with the receiving Rest endpoint.
Having looked through the RestSharp code it serializes the \ character correctly.
So when the JSON is generated it will turn your login into "partone\\afif@gmail.com"
with two \\
. You need to make sure the endpoint is correctly parsing this back into partone\afif@gmail.com
Its also a bit odd that the error is saying that it is an invalid parameter since you are sending it in the body.
Whats even stranger is that in your sample code you are attempting to post to a WSDL url. WSDL's are for SOAP web services and not restful webservices.