我試圖爲自己做小應用程序,我發現這個應用程序 How to upload video on Dailymotion with c# ?? Is somebody has a complete code?遠程服務器返回錯誤:(403)禁止。在發佈後請求...?
當我試過每一件事情,但發佈不起作用。我用小提琴手,但我找不到錯誤。 下面是代碼
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()它提供了錯誤。那麼這裏有什麼問題?
我檢查了也不過誤差保持不變。 – 2012-07-19 16:42:36