|
|
@@ -9,6 +9,7 @@ import com.dji.sample.manage.model.dto.RtmpUrlDTO;
|
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.http.HttpVersion;
|
|
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
|
|
import org.apache.http.client.methods.HttpGet;
|
|
|
import org.apache.http.impl.client.CloseableHttpClient;
|
|
|
@@ -34,6 +35,8 @@ public class CallSmsp {
|
|
|
private static final String NODE_WEBRTC = "WEBRTC";
|
|
|
private static final String NODE_CHANNELID = "ChannelID";
|
|
|
private static final String HTTPS = "https";
|
|
|
+ private static final String HTTP2 = "HTTP/1.2";
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
@@ -66,7 +69,7 @@ public class CallSmsp {
|
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
|
try {
|
|
|
Map<String,String> response = sendGetRequest(url);
|
|
|
- log.info("============Response from getSmspRtmpUrl API: " + response);
|
|
|
+ log.info("=="+protocal+"=="+rUrl+"========Response from getSmspRtmpUrl API : " + response);
|
|
|
if(response.get(NODE_DATA) != null ){
|
|
|
JsonNode rootNode = objectMapper.readTree(response.get(NODE_DATA));
|
|
|
// 遍历顶层的设备列表
|
|
|
@@ -107,6 +110,9 @@ public class CallSmsp {
|
|
|
private static Map<String,String> sendGetRequest(String requestURL) throws Exception {
|
|
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
|
|
HttpGet httpGet = new HttpGet(requestURL);
|
|
|
+ if(requestURL.startsWith(HTTPS)) {
|
|
|
+ httpGet.setProtocolVersion(new HttpVersion(1, 2));
|
|
|
+ }
|
|
|
CloseableHttpResponse response = httpClient.execute(httpGet);
|
|
|
Map<String,String> resultMap = new HashMap<>();
|
|
|
try {
|