You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
758 B
C#

6 months ago
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HttpClientStudy.UnitTest.HttpResponses
{
public class HttpResponseContentTest
{
private readonly ITestOutputHelper _output;
public HttpResponseContentTest(ITestOutputHelper testOutput)
{
_output = testOutput;
}
[Fact]
public void Test()
{
5 months ago
HttpClient client = new HttpClient();
4 months ago
var content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(new { Name="张三"}), Encoding.UTF8, System.Net.Mime.MediaTypeNames.Application.Json);
5 months ago
client.PostAsync("http://www.baidu.com", content);
6 months ago
}
5 months ago
}
6 months ago
}