public async Task <StatementsResultLRSResponse> MoreStatements(StatementsResult result) { var r = new StatementsResultLRSResponse(); var req = new MyHTTPRequest(); req.method = HttpMethod.Get; req.resource = endpoint.Authority; if (!req.resource.EndsWith("/", StringComparison.Ordinal)) { req.resource += "/"; } req.resource += result.more; var res = await MakeRequest(req); if (res.status != HttpStatusCode.OK) { r.success = false; r.httpException = res.ex; r.SetErrMsgFromBytes(res.content, (int)res.status); return(r); } r.success = true; r.content = new StatementsResult(new Json.StringOfJSON(Encoding.UTF8.GetString(res.content, 0, res.content.Length))); return(r); }
public async Task <StatementsResultLrsResponse> MoreStatementsAsync(StatementsResult result) { var r = new StatementsResultLrsResponse(); var req = new MyHttpRequest { Method = "GET", Resource = Endpoint.GetLeftPart(UriPartial.Authority) }; if (!req.Resource.EndsWith("/")) { req.Resource += "/"; } req.Resource += result.More; var res = await MakeRequest(req); if (res.Status != HttpStatusCode.OK) { r.Success = false; r.HttpException = res.Ex; r.SetErrMsgFromBytes(res.Content); return(r); } r.Success = true; var json = new Json.StringOfJson(Encoding.UTF8.GetString(res.Content)); r.Content = new StatementsResult(json); return(r); }
public StatementsResultLRSResponse MoreStatements(StatementsResult result) { var r = new StatementsResultLRSResponse(); var req = new MyHTTPRequest(); req.method = "GET"; req.resource = endpoint.GetLeftPart(UriPartial.Authority); if (!req.resource.EndsWith("/")) { req.resource += "/"; } req.resource += result.more; var res = MakeSyncRequest(req); if (res.status != HttpStatusCode.OK) { r.success = false; r.httpException = res.ex; r.SetErrMsgFromBytes(res.content); return(r); } r.success = true; r.content = new StatementsResult(new Json.StringOfJSON(Encoding.UTF8.GetString(res.content))); return(r); }
public StatementsResultLRSResponse MoreStatements(StatementsResult result) { var r = new StatementsResultLRSResponse(); var req = new MyHTTPRequest(); req.method = "GET"; req.resource = endpoint.GetLeftPart(UriPartial.Authority); if (! req.resource.EndsWith("/")) { req.resource += "/"; } req.resource += result.more; var res = MakeSyncRequest(req); if (res.status != HttpStatusCode.OK) { r.success = false; r.httpException = res.ex; r.SetErrMsgFromBytes(res.content); return r; } r.success = true; r.content = new StatementsResult(new Json.StringOfJSON(Encoding.UTF8.GetString(res.content))); return r; }