我可以使用Postman调用端点(POST)并获得有效结果。但是,当我使用HttpClient从我的Core 2应用程序调用它时,我得到405(不允许方法)状态。我的代码如下:
var content = JsonConvert.SerializeObject(token);
var stringContent = new StringContent(content, Encoding.UTF8, "application/json");
response = await client.PostAsync(Url, new StringContent(content));
var jsonstring = await response.Content.ReadAsStringAsync();
response.Content = new StringContent(jsonstring, Encoding.UTF8, "application/json");
谢谢!