Skip to content
Open
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
8 changes: 4 additions & 4 deletions RESTful service/monitor_update.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private String putHttp(String url, Map<String, String> putParams,

CloseableHttpClient httpClient = HttpClients.createDefault();
try {
HttpPut httPut = new HttpPut(url);
HttpPut httpPut = new HttpPut(url);

if (headerParams != null) {
for (String key : headerParams.keySet()) {
Expand All @@ -77,7 +77,7 @@ private String putHttp(String url, Map<String, String> putParams,
}

JSONObject jsonObject = JSONObject.fromObject(putParams);
jsonString = jsonObject.toString();
String jsonString = jsonObject.toString();

StringEntity params = new StringEntity(jsonString, "UTF-8");
params.setContentType("application/json");
Expand Down Expand Up @@ -109,12 +109,12 @@ public String update(String streamID, String streamUrl, String streamName, Strin
String record, String accessKey, String accessSecret){
String result = null;
String reqUrl = "https://api.acrcloud.com/v1/monitor-streams/"+streamID;
String htttMethod = "PUT";
String httpMethod = "PUT";
String httpAction = "/v1/monitor-streams/"+streamID;
String signature_version = "1";
String timestamp = this.getUTCTimeSeconds();

String sigStr = htttMethod + "\n" + httpAction + "\n" + accessKey
String sigStr = httpMethod + "\n" + httpAction + "\n" + accessKey
+ "\n" + signatureVersion + "\n" + timestamp;
String signature = encryptByHMACSHA1(sigStr.getBytes(),
accessSecret.getBytes());
Expand Down