extension String{
func EncodeURL() -> String{
if let url = self.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet(charactersInString:"`#%^{}\"[]|\\<> ").invertedSet){
return url
}else{
return self
}
}
func EncodeURL(param : [String : AnyObject]?) -> String{
var param_url = Strings.empty
if(param != nil){
for item in param!{
param_url += "&" + item.0 + "=" + item.1.description
}
param_url = param_url.replaceFirst(withString: "?")
}
param_url = self + param_url
return param_url.EncodeURL()
}
}