@Override public String buildRequestUrl() { String url = this.endpoint.toString(); StringBuilder builder = new StringBuilder(url); if (!url.endsWith("/")) { builder.append("/"); } String timestamp = Utilities.getTimestamp(); String signature = Utilities .getSignature(timestamp, this.decryptionKey); builder.append("login"); builder.append("?uid=" + HttpUtils.urlEncode(this.uid, false)); builder.append("&username=" + HttpUtils.urlEncode(this.username, false)); builder.append("×tamp=" + HttpUtils.urlEncode(timestamp, false)); builder.append("&signature=" + HttpUtils.urlEncode(signature, false)); return builder.toString(); }
public String buildRequestUrl() { StringBuilder builder = new StringBuilder( ( this.useSSL ? "https://" : "http://" ) ); builder.append( this.endpoint ); builder.append( "/" ); builder.append( "registerdevice" ); builder.append( "?uid=" + HttpUtils.urlEncode( this.uid, false ) ); builder.append( "&key=" + HttpUtils.urlEncode( this.key, false ) ); return builder.toString(); }
public String buildRequestUrl() { StringBuilder builder = new StringBuilder( ( this.useSSL ? "https://" : "http://" ) ); builder.append( this.endpoint ); builder.append( "/" ); String timestamp = Utilities.getTimestamp(); String signature = Utilities.getSignature( timestamp, key ); builder.append( "gettoken" ); builder.append( "?uid=" + HttpUtils.urlEncode( this.uid, false ) ); builder.append( "×tamp=" + HttpUtils.urlEncode( timestamp, false ) ); builder.append( "&signature=" + HttpUtils.urlEncode( signature, false ) ); return builder.toString(); }
public static String encode(String s) { if (null == s) return s; return HttpUtils.urlEncode(s, false); }
@Override public String buildRequestUrl() { String url = this.endpoint.toString(); StringBuilder builder = new StringBuilder(url); if (!url.endsWith("/")) { builder.append("/"); } String timestamp = Utilities.getTimestamp(); builder.append("gettoken"); builder.append("?uid=" + HttpUtils.urlEncode(this.uid, false)); builder.append("×tamp=" + HttpUtils.urlEncode(timestamp, false)); int counter = 1; StringBuilder loginString = new StringBuilder(); for (Map.Entry<String, String> entry : logins.entrySet()) { loginString.append(entry.getKey() + entry.getValue()); builder.append("&provider"); builder.append(counter); builder.append("="); builder.append(HttpUtils.urlEncode(entry.getKey(), false)); builder.append("&token"); builder.append(counter); builder.append("="); builder.append(HttpUtils.urlEncode(entry.getValue(), false)); counter++; } builder.append("&identityId=" + HttpUtils.urlEncode(identityId, false)); String signature = null; if (identityId != null) { signature = Utilities.getSignature(timestamp + loginString + identityId, key); } else { signature = Utilities.getSignature(timestamp + loginString, key); } builder.append("&signature=" + HttpUtils.urlEncode(signature, false)); return builder.toString(); }