public SearchItem SearchItems(String q, SearchType type, int limit = 20, int offset = 0) { limit = Math.Min(50, limit); StringBuilder builder = new StringBuilder("https://api.spotify.com/v1/search"); builder.Append("?q=" + q); builder.Append("&type=" + type.GetSearchValue(",")); builder.Append("&limit=" + limit); builder.Append("&offset=" + offset); return(DownloadString <SearchItem>(builder.ToString())); }
public Task <SearchItem> SearchItems(String q, SearchType type, int limit = 20, int offset = 0, string market = "US") { limit = Math.Min(50, limit); var builder = new StringBuilder("https://api.spotify.com/v1/search"); builder.Append("?q=" + WebUtility.UrlEncode(q)); builder.Append("&type=" + type.GetSearchValue(",")); builder.Append("&limit=" + limit); builder.Append("&offset=" + offset); builder.Append("&market=" + market); return(DownloadDataAsync <SearchItem>(builder.ToString())); }