I would like to get a json file in my c# code. But to get this file I need to add some parameters:
{
id = 1;
jsonrpc = "2.0";
method = getPosts;
params = {
page = 0;
};
}
How can I get the above parameters in the following code to recieve the Json file.
public void LoadData()
{
WebRequest.RegisterPrefix("http://example.com", WebRequestCreator.ClientHttp);
Uri serviceUri = new Uri("http://example.com/jsonrpc.php");
WebClient downloader = new WebClient();
downloader.OpenReadCompleted += new OpenReadCompletedEventHandler(downloader_OpenReadCompleted);
downloader.OpenReadAsync(serviceUri);
}