Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit 0a7c6c1

Browse files
authored
Luis: Now using okhttp3 instead of httpclient (#1019)
1 parent 9c13651 commit 0a7c6c1

2 files changed

Lines changed: 3 additions & 18 deletions

File tree

libraries/bot-ai-luis-v3/pom.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,6 @@
8686
<artifactId>json</artifactId>
8787
<version>20190722</version>
8888
</dependency>
89-
<dependency>
90-
<groupId>org.apache.httpcomponents</groupId>
91-
<artifactId>httpcore</artifactId>
92-
<version>4.4.13</version>
93-
<scope>compile</scope>
94-
</dependency>
95-
<dependency>
96-
<groupId>org.apache.httpcomponents</groupId>
97-
<artifactId>httpclient</artifactId>
98-
<version>4.5.13</version>
99-
<scope>compile</scope>
100-
</dependency>
10189
</dependencies>
10290

10391
<profiles>

libraries/bot-ai-luis-v3/src/main/java/com/microsoft/bot/ai/luis/LuisApplication.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
package com.microsoft.bot.ai.luis;
55

6-
import org.apache.http.NameValuePair;
7-
import org.apache.http.client.utils.URIBuilder;
6+
import okhttp3.HttpUrl;
87
import java.net.MalformedURLException;
98
import java.net.URISyntaxException;
109
import java.net.URL;
@@ -168,11 +167,9 @@ private void parse(String applicationEndpoint) {
168167
}
169168

170169
try {
171-
172-
String endpointKeyParsed = new URIBuilder(applicationEndpoint).getQueryParams()
170+
String endpointKeyParsed = HttpUrl.parse(applicationEndpoint)
171+
.queryParameterValues("subscription-key")
173172
.stream()
174-
.filter(param -> param.getName().equalsIgnoreCase("subscription-key"))
175-
.map(NameValuePair::getValue)
176173
.findFirst()
177174
.orElse("");
178175

0 commit comments

Comments
 (0)