c# examples:

License Request

Requests into this service are sent as HTTP POST requests to: http://blurthis.com/rest/lpr/blur
The post should contain a stream and a one paramater as shown below:

 using (var client = new HttpClient())
{
    var content = new MultipartFormDataContent();
    byte[] bytes = new byte[(int)stream.Length];
    using (MemoryStream memoryStream = new MemoryStream())
    {
        int count;
        while ((count = stream.Read(bytes, 0, (int)stream.Length)) > 0)
        {
            memoryStream.Write(bytes, 0, count);
        }
        var baContent = new ByteArrayContent(memoryStream.ToArray());
        content.Add(baContent, "File", File.FileName);
        var parameters = new Dictionary { { "IncludeResponseImage", "true" } };
        var encodedContent = new FormUrlEncodedContent(parameters);
        content.Add(encodedContent, "params");
    }
    var response =  client.PostAsync("http://blurthis.com/rest/lpr/blur", content)
}
                                    

License Response

Results will be sent back in the following JSON format:


{
    "Base64Image":"/9j/4AAQSkZJRgABAQEAYABgAAD/2w.......",
    "Rectangles":[{"Points":[{"X":1583,"Y":383},{"X":1583,"Y":402},{"X":1651,"Y":383},{"X":1651,"Y":402}]},{"Points":[{"X":781,"Y":879},{"X":781,"Y":963},{"X":1136,"Y":879},{"X":1136,"Y":963}]}]
}
                                    

Face Request

Requests into this service are sent as HTTP POST requests to: http://blurthis.com/rest/face/blur
The post should contain a stream and a one paramater as shown below:

 using (var client = new HttpClient())
{
    var content = new MultipartFormDataContent();
    byte[] bytes = new byte[(int)stream.Length];
    using (MemoryStream memoryStream = new MemoryStream())
    {
        int count;
        while ((count = stream.Read(bytes, 0, (int)stream.Length)) > 0)
        {
            memoryStream.Write(bytes, 0, count);
        }
        var baContent = new ByteArrayContent(memoryStream.ToArray());
        content.Add(baContent, "File", File.FileName);
        var parameters = new Dictionary { { "BlurFaces", "true" } };
        var encodedContent = new FormUrlEncodedContent(parameters);
        content.Add(encodedContent, "params");
    }
    var response =  client.PostAsync("http://blurthis.com/rest/face/blur", content)
}
                                    

Face Response

Results will be sent back in the following JSON format:


{
{"Faces":[{"Face":[{"X":325,"Y":90},{"X":555,"Y":90},{"X":325,"Y":320},{"X":555,"Y":320}],"RightEye":[{"X":457,"Y":150},{"X":515,"Y":150},{"X":457,"Y":208},{"X":515,"Y":208}],"LeftEye":[{"X":365,"Y":150},{"X":421,"Y":150},{"X":365,"Y":206},{"X":421,"Y":206}]},{"Face":[{"X":50,"Y":82},{"X":270,"Y":82},{"X":50,"Y":302},{"X":270,"Y":302}],"RightEye":[{"X":175,"Y":145},{"X":235,"Y":145},{"X":175,"Y":205},{"X":235,"Y":205}],"LeftEye":[{"X":76,"Y":140},{"X":137,"Y":140},{"X":76,"Y":201},{"X":137,"Y":201}]}]
,"Base64Image":"/9j/4AAQSkZJRgABAQEAYABgAAD/2w......."}
}