NET

using System;
using RestSharp;
using Newtonsoft.Json;
using System.IO;
using RestSharp.Authenticators;
using RestSharp.Serialization;
using System.Net.Mail;
using System.Net;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
namespace test
{
class Program
{
static void Main(string[] args)
{
IRestClient client = new RestClient("https://api.wepdf.io/v1/render?apikey=YOUR_API_KEY");
client.Authenticator = new HttpBasicAuthenticator("", "");
IRestRequest request = new RestRequest(Method.POST);
var json = new
{
url = "https://en.wikipedia.org/wiki/PDF"
};
request.AddJsonBody(json);
IRestResponse response = client.Execute(request);
if (!response.IsSuccessful)
{
// Check why status is not int 2xx.
}
else
{
File.WriteAllBytes("wikipedia.pdf", response.RawBytes);
}
}
}
}