From 5ce08d6c99933c8ff4a2c4ea3f91b2fc9370f529 Mon Sep 17 00:00:00 2001 From: tracyboehrer Date: Wed, 24 Feb 2021 11:06:23 -0600 Subject: [PATCH] Luis: Now using okhttp3 instead of httpclient --- libraries/bot-ai-luis-v3/pom.xml | 12 ------------ .../com/microsoft/bot/ai/luis/LuisApplication.java | 9 +++------ 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/libraries/bot-ai-luis-v3/pom.xml b/libraries/bot-ai-luis-v3/pom.xml index 943354b84..6ecfe0ba0 100644 --- a/libraries/bot-ai-luis-v3/pom.xml +++ b/libraries/bot-ai-luis-v3/pom.xml @@ -86,18 +86,6 @@ json 20190722 - - org.apache.httpcomponents - httpcore - 4.4.13 - compile - - - org.apache.httpcomponents - httpclient - 4.5.13 - compile - diff --git a/libraries/bot-ai-luis-v3/src/main/java/com/microsoft/bot/ai/luis/LuisApplication.java b/libraries/bot-ai-luis-v3/src/main/java/com/microsoft/bot/ai/luis/LuisApplication.java index 1d8dc181e..b7e7b9a75 100644 --- a/libraries/bot-ai-luis-v3/src/main/java/com/microsoft/bot/ai/luis/LuisApplication.java +++ b/libraries/bot-ai-luis-v3/src/main/java/com/microsoft/bot/ai/luis/LuisApplication.java @@ -3,8 +3,7 @@ package com.microsoft.bot.ai.luis; -import org.apache.http.NameValuePair; -import org.apache.http.client.utils.URIBuilder; +import okhttp3.HttpUrl; import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; @@ -168,11 +167,9 @@ private void parse(String applicationEndpoint) { } try { - - String endpointKeyParsed = new URIBuilder(applicationEndpoint).getQueryParams() + String endpointKeyParsed = HttpUrl.parse(applicationEndpoint) + .queryParameterValues("subscription-key") .stream() - .filter(param -> param.getName().equalsIgnoreCase("subscription-key")) - .map(NameValuePair::getValue) .findFirst() .orElse("");