public async Task <IResponse> SendRequestAsync(IMailjetRequest request) { var req = new HttpRequestMessage(request.HttpMethod, request.Uri) { Content = new StringContent(request.RequestBody.ToString(), Encoding.UTF8, "application/json"), }; req.Headers.Authorization = request.AuthenticationHeaderValue; req.Headers.UserAgent.ParseAdd(request.UserAgent); Log.Info($"Sending {request.HttpMethod} request to {request.Uri}"); Log.Debug($"Request body: {Environment.NewLine} {request.RequestBody.ToString()}"); var res = await HttpClient.SendAsync(req); Log.Info($"Request was successful: " + res.IsSuccessStatusCode); var content = await res.Content.ReadAsStringAsync(); Log.Debug("Response body: " + content); return(new ResponseBase(content, (int)res.StatusCode, res.IsSuccessStatusCode)); }
public Task <IResponse> SendRequestAsync(IMailjetRequest request) { throw new NotImplementedException(); }