문제

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