Код: Выделить всё
using var requestMessage = CreateRequest(authenticationResponse, HttpMethod.Post, uri);
var requestJson = JsonConvert.SerializeObject(request, _serializerSettings);
requestMessage.Content = new StringContent(requestJson, Encoding.UTF8, "application/json");
_logger.LogInformation($"[{nameof(PerformApiSearchQueryAsync)}] RequestContent='{requestMessage.Content.ToString()}'");
// perform a keywords API search
using var response = await _client.SendAsync(requestMessage);
_logger.LogInformation($"[{nameof(PerformApiSearchQueryAsync)}] Api responded with '{response.StatusCode}'. accesstoken='{authenticationResponse.AccessToken.Sanitize()}'");
2025-06-14 16: 21: 46.3217 | info | binner.common.integrations.digikeyapi | [refermapisearchqueryasync] requestContent = 'System.htp.StringContent' | Я пробовал много вариантов этого, но безрезультатно. Как записать содержимое requestmessage.content ?
Заранее спасибо.
Подробнее здесь: https://stackoverflow.com/questions/796 ... ody-to-log
Мобильная версия