public async Task <RequestValidationResponse> GetAsync(ClientId clientId) { var response = await _requestToDebug.GetAsync(clientId, GoogleEndpointAddresses.DebugCollect).ConfigureAwait(false); return(JsonConvert.DeserializeObject <RequestValidationResponse>(response)); }
private async Task <ResponseData <T> > HandleGetResquest <T>(string resource, Dictionary <string, string> arguments) { var request = requestBase.PrepareRequest(resource, HttpMethod.Get, arguments); var response = await requestBase.GetAsync(request); try { return(Deserialize <T>(response)); } catch (JsonSerializationException) { var errorResponse = JsonConvert.DeserializeObject <ResponseDataError>(response, new JsonSerializerSettings { MissingMemberHandling = MissingMemberHandling.Ignore }); return(new ResponseData <T>() { Message = errorResponse.Message, ErrorNo = errorResponse.ErrorNo, Request = errorResponse.Request }); } catch (Exception) { throw; } }
/// <summary> /// Performs the request. /// </summary> /// <param name="url">The URL.</param> /// <returns>Task<System.String>.</returns> private async Task <string> PerformRequest(string url) { RequestBase req = new RequestBase(url, GetHeader()); var response = await req.GetAsync(); return(response.Content); }