public static StrObjectDict HttpDataToDict(this HttpRequestBase request, bool emptyAsKey) { //return new StrObjectDict().Merger(request.Form); if (request.ContentType.IndexOf("application/json") > -1) { try { StreamReader reader = new StreamReader(request.InputStream, request.ContentEncoding); string req = reader.ReadToEnd(); object oi = JsonAdapter.FromJsonAsDictionary(req); return(StrObjectDict.FromVariable(oi, emptyAsKey)); } catch (Exception) { throw; } } var o = StrObjectDict.FromVariable(request.Form, emptyAsKey); StrObjectDict sod = new StrObjectDict(); sod.Add("Params", o.Merger(request.QueryString)); return(sod); }
public static IDictionary <string, string> MergerJson(this IDictionary <string, string> dictionary, string jsonstr, bool nullValueAsKey, ECase keyECase) { return(dictionary.Merger(JsonAdapter.FromJsonAsDictionary(jsonstr), nullValueAsKey, keyECase)); }
public static System.Collections.Generic.IDictionary <string, object> MergerJson(this IDictionary <string, object> dictionary, string jsonstr, bool nullValueAsKey, ECase keyECase) { return(dictionary.Merger(JsonAdapter.FromJsonAsDictionary(jsonstr), nullValueAsKey, keyECase)); }