Skip to main content
Skip table of contents

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
PY
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())
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.