internal async Task <string> PerformRequestAsync(string entity, string id, string extra) { var json = await Query.ApplyDelayAsync(() => this.PerformRequestAsync($"{entity}/{id}{extra}", Method.GET, "application/json", null)); Debug.Print($"[{DateTime.UtcNow}] => RESPONSE: <<\n{JsonConvert.DeserializeObject(json)}\n>>"); return(json); }
internal async Task <string> PerformRequestAsync(string entity, string?id, string extra) { var address = $"{entity}/{id}{extra}"; var json = await Query.ApplyDelayAsync(() => this.PerformRequestAsync(address, Method.GET, "application/json", null)); Debug.Print($"[{DateTime.UtcNow}] => JSON: <<{JsonUtils.Prettify(json)}>>"); return(json); }
internal async Task <string> PerformSubmissionAsync(ISubmission submission) { var address = $"{submission.Entity}/?client={submission.Client}"; var method = submission.Method; var contentType = submission.ContentType; var body = submission.RequestBody; var msg = await Query.ApplyDelayAsync(() => this.PerformRequestAsync(address, method, "application/json", contentType, body)); return(Query.ExtractMessage(msg) ?? ""); }
internal async Task <string> PerformSubmissionAsync(ISubmission submission) { return(Query.ExtractMessage(await Query.ApplyDelayAsync(() => this.PerformRequestAsync($"{submission.Entity}/?client={submission.Client}", submission.Method, "application/json", submission.ContentType, submission.RequestBody)))); }