调试HttpClient请求

时间:2018-05-18 12:31:01

标签: http asp.net-core

如何确切了解HttpClient发送的请求将包含哪些内容?

var httpClient = new HttpClient();

        var postData = JsonConvert.SerializeObject(
            new
            {
                merchantId = _merchantId,
                amount = _amount,
                paymentRef = _paymentRef,
                customer_ref = _customer_ref,
                successUrl = _successUrl,
                error_url = _error_url,
                currency = _currency,
                hash = "fsdfsdfsdf"

            });

        HttpResponseMessage response = await httpClient.PostAsync(url, new StringContent(postData));

0 个答案:

没有答案