Luis: Now using okhttp3 instead of httpclient (#1019)
This commit is contained in:
Родитель
9c13651965
Коммит
0a7c6c1f90
|
@ -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>
|
||||
|
|
|
@ -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 @@ public class LuisApplication {
|
|||
}
|
||||
|
||||
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("");
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче