public virtual byte[] GetJson() { byte[] result = null; if (body != null) { result = body.GetJson(); } return(result); }
public IEnumerable <Byte> GetJson() { IEnumerable <Byte> result = null; if (body != null) { result = body.GetJson(); } return(result); }
internal virtual object ParseJSONResponse(HttpURLConnection conn) { Object result = null; var stream = conn.GetOutputStream(); var bytesRead = 0L; const Int32 chunkSize = 8192; var bytes = stream.ReadAllBytes(); var responseBody = new Body(bytes); if (responseBody != null) { var json = responseBody.GetJson(); String jsonString = null; if (json != null) { jsonString = Runtime.GetStringForBytes(json); try { result = mapper.ReadValue<object>(jsonString); } catch (Exception) { Assert.Fail(); } } } return result; }