There is a code:
var client = new RestClient("http://api2.online-convert.com/jobs"); var request = new RestRequest(Method.POST); request.AddHeader("cache-control", "no-cache"); request.AddHeader("x-oc-api-key", "<your API key here>"); request.AddParameter("application/json", "{\"input\":[{\"type\":\"remote\",\"source\":\"http://static.online-convert.com/example-file/raster%20image/jpg/example_small.jpg\"}],\"conversion\":[{\"category\":\"image\",\"target\":\"png\"}]}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); But it is used on the old .Net version. The new class has no RestClient and RestRequest. I began to redo:
HttpWebRequest request = null; request = (HttpWebRequest)WebRequest.Create("http://api2.online-convert.com/jobs"); request.Accept = @"application/json;text/xml"; request.Method = "POST"; Stream requestStream = request.GetRequestStreamAsync().Result; But I do not know how I use the parameters:
request.AddParameter("application/json", "{\"input\":[{\"type\":\"remote\",\"source\":\"http://static.online-convert.com/example-file/raster%20image/jpg/example_small.jpg\"}],\"conversion\":[{\"category\":\"image\",\"target\":\"png\"}]}", ParameterType.RequestBody);