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

Commit

Permalink
Luis: Now using okhttp3 instead of httpclient (#1019)
Browse files Browse the repository at this point in the history
  • Loading branch information
tracyboehrer authored Feb 24, 2021
1 parent 9c13651 commit 0a7c6c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
12 changes: 0 additions & 12 deletions libraries/bot-ai-luis-v3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,6 @@
<artifactId>json</artifactId>
<version>20190722</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.13</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
<scope>compile</scope>
</dependency>
</dependencies>

<profiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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("");

Expand Down

0 comments on commit 0a7c6c1

Please sign in to comment.