POST請求特殊字符我有這樣的C#方法在內部C#應用程序
public void TestMethod1()
{
string login = @"partone\[email protected]" ;
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;
}
的問題是在登錄串的特殊字符\
,它會產生無效authentifier
參數。
所以我需要知道我該如何解決這個問題?
嘗試使用正斜槓。 – jdweng
RestSharp DLL或REST端點引發錯誤嗎? – CathalMF