latest 6.4.0 6.3.1 6.3.0 6.2.0 6.1.0 6.0.0 5.9.1 5.9.0 5.8.0 5.7.0 5.6.0 5.5.0 5.4.0 5.3.0 5.1.1 5.1.0 5.0.0 4.4.0 4.3.0 4.2.1 4.2.0 4.1.1
Auto Light Dark
Auto Light Dark
latest 6.4.0 6.3.1 6.3.0 6.2.0 6.1.0 6.0.0 5.9.1 5.9.0 5.8.0 5.7.0 5.6.0 5.5.0 5.4.0 5.3.0 5.1.1 5.1.0 5.0.0 4.4.0 4.3.0 4.2.1 4.2.0 4.1.1

Natural Language Understanding ‎

This example sends a POST request with a parser name and text to analyse to the Vdk-Service, checks for a successful response, and prints the response body.

C# Example
C#
using System.Text.Json;
using System.Net.WebSockets;
using System.Text;

using (var client = new HttpClient())
{
    var request = new { parser = "myParser", text = "decrease the heat in 2 min" };
    const string parseUri = "http://localhost:39806/v1/nlu/parse";
    var content = new StringContent(JsonSerializer.Serialize(request), Encoding.UTF8, "application/json");
    var response = await client.PostAsync(parseUri, content);
    response.EnsureSuccessStatusCode();
    var responseBody = await response.Content.ReadAsStringAsync();
    Console.WriteLine(responseBody);
}

Python Example
Python
import asyncio
import json
import requests

async def main():
    request_data = {
        "parser": "myParser",
        "text": "decrease the heat in 2 min"
    }
    parse_uri = "http://localhost:39806/v1/nlu/parse"

    response = requests.post(parse_uri, json=request_data)
    response_body = response.json()
    print(response_body)
    response.raise_for_status()

if __name__ == "__main__":
    asyncio.run(main())