Skip to content

Commit c473863

Browse files
author
Javen
committed
Refactoring: no need content param for sendGet
1 parent fe3e72b commit c473863

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/cn/jpush/api/common/IHttpClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public enum RequestMethod {
4949

5050
public static final int DEFAULT_MAX_RETRY_TIMES = 3;
5151

52-
public ResponseWrapper sendGet(String url, String params)
52+
public ResponseWrapper sendGet(String url)
5353
throws APIConnectionException, APIRequestException;
5454

5555
public ResponseWrapper sendPost(String url, String content)

src/cn/jpush/api/common/NativeHttpClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ public NativeHttpClient(String authCode, int maxRetryTimes, HttpProxy proxy) {
4545
initSSL();
4646
}
4747

48-
public ResponseWrapper sendGet(String url, String params)
48+
public ResponseWrapper sendGet(String url)
4949
throws APIConnectionException, APIRequestException {
50-
return sendRequest(url, params, RequestMethod.GET);
50+
return sendRequest(url, null, RequestMethod.GET);
5151
}
5252

5353
public ResponseWrapper sendPost(String url, String content)

src/cn/jpush/api/report/ReportClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public ReceivedsResult getReceiveds(String msgIds)
4747
checkMsgids(msgIds);
4848

4949
String url = REPORT_HOST_NAME + REPORT_RECEIVE_PATH + "?msg_ids=" + msgIds;
50-
ResponseWrapper response = _httpClient.sendGet(url, null);
50+
ResponseWrapper response = _httpClient.sendGet(url);
5151

5252
return ReceivedsResult.fromResponse(response);
5353
}
@@ -57,7 +57,7 @@ public MessagesResult getMessages(String msgIds)
5757
checkMsgids(msgIds);
5858

5959
String url = REPORT_HOST_NAME + REPORT_MESSAGE_PATH + "?msg_ids=" + msgIds;
60-
ResponseWrapper response = _httpClient.sendGet(url, null);
60+
ResponseWrapper response = _httpClient.sendGet(url);
6161

6262
return MessagesResult.fromResponse(response);
6363
}
@@ -73,7 +73,7 @@ public UsersResult getUsers(TimeUnit timeUnit, String start, int duration)
7373
String url = REPORT_HOST_NAME + REPORT_USER_PATH
7474
+ "?time_unit=" + timeUnit.toString()
7575
+ "&start=" + startEncoded + "&duration=" + duration;
76-
ResponseWrapper response = _httpClient.sendGet(url, null);
76+
ResponseWrapper response = _httpClient.sendGet(url);
7777

7878
return UsersResult.fromResponse(response);
7979
}

0 commit comments

Comments
 (0)