/// <summary> /// Gets/Sets the specified value /// </summary> public dynamic this[string key] { get { if (!Values.ContainsKey(key)) return null; object result = Values[key]; if (result is IDictionary<string, object>) result = new JsonDataObject(result as IDictionary<string, object>); else if (result is ArrayList) { ArrayList resultList = result as ArrayList; ArrayList dataList = new ArrayList(); foreach (object current in resultList) { if (current is IDictionary<string, object>) dataList.Add(new JsonDataObject(current as IDictionary<string, object>)); else dataList.Add(current); } result = dataList; } return result; } set { if (Values.ContainsKey(key)) Values[key] = value; else Values.Add(key, value); } }
/// <summary> /// Performs a post of data to the provided URI. /// </summary> public RestResponse Post(Uri uri, JsonDataObject data, IDictionary<string, string> headers = null) { return Post(uri, Serializer.Serialize(data), headers); }