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

Luis: Now using okhttp3 instead of httpclient #1019

Merged
merged 1 commit into from
Feb 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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