From 811626f1e9b9a14fdaebe1cf9f3bf00a3c3a6532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20G=C3=B3mez=20Vilches?= Date: Wed, 7 Dec 2016 14:13:17 +0100 Subject: [PATCH] Update InstasentClient.java --- api/src/com/instasent/InstasentClient.java | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/api/src/com/instasent/InstasentClient.java b/api/src/com/instasent/InstasentClient.java index 876a9ba..010a17e 100644 --- a/api/src/com/instasent/InstasentClient.java +++ b/api/src/com/instasent/InstasentClient.java @@ -9,23 +9,17 @@ public class InstasentClient { - private String rootEndpoint = "http://api.instasent.codes"; - private String secureChannel = "http://api.instasent.codes"; + private String secureChannel = "https://api.instasent.codes"; private String token; - private boolean userSecureChannel = true; - public InstasentClient(String token, boolean useSecureChannel) { + public InstasentClient(String token) { this.token = token; - this.userSecureChannel = useSecureChannel; } public Map sendSms(String from, String to, String text) { String url; - if (this.userSecureChannel) - url = this.secureChannel + "/sms/"; - else - url = this.rootEndpoint + "/sms/"; + url = this.secureChannel + "/sms/"; String httpMethod = "POST"; @@ -41,10 +35,7 @@ public Map getSms(int page, int per_page) { String url; - if (this.userSecureChannel) - url = this.secureChannel + "/sms/?" + "page=" + page + "&per_page=" + per_page; - else - url = this.rootEndpoint + "/sms/?" + "page=" + page + "&per_page=" + per_page; + url = this.secureChannel + "/sms/?" + "page=" + page + "&per_page=" + per_page; String httpMethod = "GET"; @@ -57,10 +48,7 @@ public Map getSmsById(String id) { String url; - if (this.userSecureChannel) - url = this.secureChannel + "/sms/" + id; - else - url = this.rootEndpoint + "/sms/" + id; + url = this.secureChannel + "/sms/" + id; String httpMethod = "GET";