You are here

MPT REST API usage example for .NET/C#

With Microsoft .NET environment and C# language you can formulate the HTTP request to Connexor Machinese Phrase Tagger Webservice the following way:

using System.Net.Http;

using (var client = new HttpClient())
{
    var values = new Dictionary<string, string>
    {
       { "AuthKey", "YourAuthorizationKey" },
       { "text", "This is a test." }
    };

    var content = new FormUrlEncodedContent(values);

    var response = await client.PostAsync("http://cxserv2.nlpengine.net/serv/tech/fdg1/en/", content);

    var responseString = await response.Content.ReadAsStringAsync();
}

Note: Remember to change the "YourAuthorizationKey" variable value to your actual MPT web service authorization key.