3. Code Example
C#
using (HttpClient client = new HttpClient())
{
string PublicKey = "{Your public key}";
string PrivateKey = "{Your private key}";
string RequestAddress = "https://api.igsend.co.uk/services/country"
client.BaseAddress = new Uri(RequestAddress);
var auth = string.Format("{0}:{1}", PublicKey, PrivateKey);
var encoded = Convert.ToBase64String(Encoding.ASCII.GetBytes(auth));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", encoded);
HttpResponseMessage response = await client.GetAsync(RequestAddress);
}
If you develop in another code, which may be useful to other customers, we would love to include further examples here. You can submit your example code to
the API team.