Skip to content

Instantly share code, notes, and snippets.

@cgbystrom
Created September 14, 2010 07:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cgbystrom/578667 to your computer and use it in GitHub Desktop.
Save cgbystrom/578667 to your computer and use it in GitHub Desktop.
public function generateUri(protocol:String = "ws"):String {
var uri:String = protocol + "://" + host + "/spheres/" + apiKey + "/users/" + user;
var params:Array = ['authToken=t'];
if (sequenceId > 0) { params.push("sequenceId=" + sequenceId); }
if (channels && channels.length > 0) { params.push("channels=" + channels.join(',')); }
if (params.length > 0) {
uri += "?";
uri += params.join('&');
}
return uri;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment