private static void GetDataResponseNormalAsync(TwentyThree flickr, string baseUrl, Dictionary <string, string> parameters, Action <TwentyThreeResult <string> > callback) { var method = "POST"; var data = string.Empty; foreach (var k in parameters) { data += k.Key + "=" + UtilityMethods.EscapeDataString(k.Value) + "&"; } if (method == "GET" && data.Length > 2000) { method = "POST"; } if (method == "GET") { DownloadDataAsync(method, baseUrl + "?" + data, null, null, null, callback); } else { DownloadDataAsync(method, baseUrl, data, PostContentType, null, callback); } }
private static string GetDataResponseNormal(TwentyThree flickr, string baseUrl, Dictionary <string, string> parameters) { string method = "POST"; string data = string.Empty; foreach (var k in parameters) { data += k.Key + "=" + UtilityMethods.EscapeDataString(k.Value) + "&"; } if (method == "GET" && data.Length > 2000) { method = "POST"; } if (method == "GET") { return(DownloadData(method, baseUrl + "?" + data, null, null, null)); } else { return(DownloadData(method, baseUrl, data, PostContentType, null)); } }
/// <summary> /// Gets a data response for the given base url and parameters, /// </summary> /// <param name="flickr">The current instance of the <see cref="TwentyThree"/> class.</param> /// <param name="baseUrl">The base url to be called.</param> /// <param name="parameters">A dictionary of parameters.</param> /// <param name="callback"></param> /// <returns></returns> public static void GetDataResponseAsync(TwentyThree flickr, string baseUrl, Dictionary <string, string> parameters, Action <TwentyThreeResult <string> > callback) { GetDataResponseNormalAsync(flickr, baseUrl, parameters, callback); }
/// <summary> /// Gets a data response for the given base url and parameters, /// </summary> /// <param name="flickr">The current instance of the <see cref="TwentyThree"/> class.</param> /// <param name="baseUrl">The base url to be called.</param> /// <param name="parameters">A dictionary of parameters.</param> /// <returns></returns> public static string GetDataResponse(TwentyThree flickr, string baseUrl, Dictionary <string, string> parameters) { return(GetDataResponseNormal(flickr, baseUrl, parameters)); }