Вопрос

I want to send data Json in a web request to the web service in json format and get the result from the server. a lot of methods .. :p

Please help me to find a solution.

Это было полезно?

Решение

You can use (for ex.) RestClient ftom restsharp

_restClient = new RestClient();
var request = new RestRequest(url) { Method = Method.POST };
request.AddHeader("content-type", "application/json");
request.RequestFormat = DataFormat.Json;
request.AddParameter("json", YOUR_JSON, ParameterType.GetOrPost);
request.Timeout = DEFAULT_TIMEOUT;
_restClient.Timeout = Constants.DEFAULT_TIMEOUT;
_restClient.ExecuteAsync(request, response =>
{
           // check response here
});
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top