public static DeserializeWoopsaValue ( string jsonText ) : |
||
jsonText | string | |
Résultat |
public WoopsaValue Write(string path, string value) { var arguments = new NameValueCollection { { WoopsaFormat.KeyValue, value } }; string response = Request(WoopsaFormat.VerbWrite + path, arguments); return(WoopsaFormat.DeserializeWoopsaValue(response)); }
internal void DispatchResults(WoopsaJsonData jsonData) { if (jsonData.IsArray) { for (int i = 0; i < jsonData.Length; i++) { WoopsaJsonData item = jsonData[i]; int id = item[WoopsaFormat.KeyId]; WoopsaClientRequest request; if (_clientRequestsById.TryGetValue(id, out request)) { WoopsaJsonData result = item[WoopsaFormat.KeyResult]; if (result.ContainsKey(WoopsaFormat.KeyError)) { request.Result = new WoopsaClientRequestResult() { Error = WoopsaFormat.DeserializeError(result.AsText), ResultType = WoopsaClientRequestResultType.Error }; } else if (request.Request.Verb == WoopsaFormat.VerbMeta) { request.Result = new WoopsaClientRequestResult() { Meta = WoopsaFormat.DeserializeMeta(result.AsText), ResultType = WoopsaClientRequestResultType.Meta }; } else { request.Result = new WoopsaClientRequestResult() { Value = WoopsaFormat.DeserializeWoopsaValue(result.AsText), ResultType = WoopsaClientRequestResultType.Value }; } request.IsDone = true; } else { throw new WoopsaException( string.Format("MultiRequest received a result for an unkwnon request Id={0}", id)); } } } else { throw new WoopsaException("MultiRequest response has invalid format"); } }
public WoopsaValue Invoke(string path, NameValueCollection arguments, TimeSpan timeout) { string response = Request(WoopsaFormat.VerbInvoke + path, arguments, timeout); return(WoopsaFormat.DeserializeWoopsaValue(response)); }
public WoopsaValue Read(string path) { string response = Request(WoopsaFormat.VerbRead + path); return(WoopsaFormat.DeserializeWoopsaValue(response)); }