public ApigeeResponse(JToken rawData, string wantedKey) { RawResponse = rawData.ToString(); try { this.ResponseData = rawData[wantedKey]; this.success = true; } catch (Exception) { this.Error = new ApigeeResponseError("error"); this.success = false; } }
public ApigeeResponse(string rawData, bool ExtractEnteties) { RawResponse = rawData; if (!ExtractEnteties) return; //safty var enteties = GetEntitiesFromJson(rawData); if (enteties == null) { this.success = false; this.Error = new ApigeeResponseError(JObject.Parse(rawData)); } else { this.success = true; this.ResponseData = enteties; } }
public ApigeeResponse(JObject rawData, string wantedKey) { RawResponse = rawData.ToString(); try { this.ResponseData = rawData.SelectToken(wantedKey, true); this.success = true; } catch (Exception) { var errorMsg = rawData.SelectToken("error_description").ToString(); if (String.IsNullOrEmpty(errorMsg)) errorMsg = "Unknown Error"; this.Error = new ApigeeResponseError(errorMsg); this.success = false; } }
public ApigeeResponse(JObject rawData, string wantedKey) { RawResponse = rawData.ToString(); try { this.ResponseData = rawData.SelectToken(wantedKey, true); this.success = true; } catch (Exception) { var errorMsg = rawData.SelectToken("error_description").ToString(); if (String.IsNullOrEmpty(errorMsg)) { errorMsg = "Unknown Error"; } this.Error = new ApigeeResponseError(errorMsg); this.success = false; } }
public ApigeeResponse(string rawData, bool ExtractEnteties) { RawResponse = rawData; if (!ExtractEnteties) { return; //safty } var enteties = GetEntitiesFromJson(rawData); if (enteties == null) { this.success = false; this.Error = new ApigeeResponseError(JObject.Parse(rawData)); } else { this.success = true; this.ResponseData = enteties; } }