Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only use secure channel #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
22 changes: 5 additions & 17 deletions api/src/com/instasent/InstasentClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String> 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";

Expand All @@ -41,10 +35,7 @@ public Map<String, String> 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";

Expand All @@ -57,10 +48,7 @@ public Map<String, String> 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";

Expand Down