public async Task <ProcessingResponse?> SendPostRequest(RequestParams requestParams) { requestParams.ThrowIfNull(nameof(requestParams)); _logger.Info($"Service method '{nameof(SendPostRequest)}' is called."); using HttpResponseMessage response = await _client.PostAsJsonAsync( _apiUrl, requestParams ); if (response.IsSuccessStatusCode) { var result = await response.Content.ReadAsAsync <ProcessingResponse>(); return(result); } return(null); }
public bool TryAddUser(long id, RequestParams requestParams) { requestParams.ThrowIfNull(nameof(requestParams)); return(_cache.TryAdd(id, requestParams)); }