Answer the question
In order to leave comments, you need to log in
Using the webnames.ru API (RegTimeSRS) in C#
Hello, I'm trying to call the above via HttpWebRequest. Everything is fine with Latin, but there is a problem with Cyrillic fields:
person_r: "Person (in russian)" field must contain latin or cyrillic letters, digits, spaces or . , - ( ) " & # / + '.
etc. while the fields are taken from their docks ("Vasily Nikolaevich Pupkin") foreach (string key in param.Keys) // param - NameValueCollection со сформированными параметрами
{
parameters.AppendFormat("{0}={1}&",
HttpUtility.UrlEncode(key),
HttpUtility.UrlEncode(param[key])
);
}
var encoded = parameters.ToString().TrimEnd('&');
var request = (HttpWebRequest)HttpWebRequest.Create(ServiceURL);
request.ProtocolVersion = HttpVersion.Version10;
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded; charset=utf-8";
using (var writer = new StreamWriter(request.GetRequestStream()))
{
writer.Write(encoded);
}
Answer the question
In order to leave comments, you need to log in
These gentlemen seem to have a very hard time writing docs. The description says that you need to load in UTF-8, but you need to ... windows-1251
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question