我尝试为自己制作小型应用程序,我发现了这个应用程序 如何使用 c# 在 Dailymotion 上上传视频?有人有完整的代码吗?
当我尝试了所有事情但发布不起作用时。我使用了提琴手,但我找不到错误。这是代码
var request = WebRequest.Create("https://api.dailymotion.com/me/videos?url=" + Uri.EscapeUriString(uploadResponse.url));
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.Headers.Add("Authorization", "OAuth " + accessToken);
var requestBytes = Encoding.UTF8.GetBytes("title=test 123&channel=Funny&tags=Humor&description=Testing testing&published=true");
var requestBytes = Encoding.UTF8.GetBytes(requestString);
var requestStream = request.GetRequestStream();
requestStream.Write(requestBytes, 0, requestBytes.Length);
var response = request.GetResponse();
var responseStream = response.GetResponseStream();
string responseString;
using (var reader = new StreamReader(responseStream))
{
responseString = reader.ReadToEnd();
}
当它到达 request.GetResponse() 时,它会给出错误。那么这里有什么问题..?