【发布时间】:2021-01-19 23:20:28
【问题描述】:
我已经尝试过使用 Web 应用程序,它正在工作。但是当我在 c# windows 应用程序中做同样的事情时,给出的响应是
无法发布到 Twitter。
async Task<Tuple<int, string>> SendImage(string URL, MultipartFormDataContent multipartContent)
{
using (var httpClient = new HttpClient())
{
httpClient.DefaultRequestHeaders.Add("Authorization", PrepareOAuth(URL, null, "POST"));
var httpResponse = await httpClient.PostAsync(URL, multipartContent);
var httpContent = await httpResponse.Content.ReadAsStringAsync();
return new Tuple<int, string>(
(int)httpResponse.StatusCode,
httpContent
);
}
}
在 httpResponse 代码上,我得到下面显示的错误。
发布到 TwitterError 的未知错误
【问题讨论】:
标签: c# windows twitter image-upload