远程服务器返回错误:(403)禁止.在发帖期间...?

编程入门 行业动态 更新时间:2024-10-21 03:50:57
本文介绍了远程服务器返回错误:(403)禁止.在发帖期间...?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我尝试为自己制作一个小型应用程序,但我发现了这个应用程序如何使用C#在Dailymotion上上传视频?有人有完整的代码吗?

I try to make small application for myself and I found this application How to upload video on Dailymotion with c# ?? Is somebody has a complete code?

当我尝试所有操作但发布不起作用时.我使用了提琴手,但我找不到错误.这是代码

When I tried every thing but publishing is not working. I used fiddler but I cant find the error. Here is the code

var request = WebRequest.Create("api.dailymotion/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()时,将给出错误.那么,这里出了什么问题??

When it reaches request.GetResponse() it gives the error. So what is the problem here..?

推荐答案

我相信您在使用OAuth而不是基本身份验证时需要摆脱url中的我",

I believe you need to get rid of the "me" in the url as you're using OAuth instead of basic authentication, like this:

"api.dailymotion/videos?url="

代替:

"api.dailymotion/me/videos?url="

至少在一个看起来像这样的快速扫描中,一年前,我为一个客户端编写了一个自动发布器,它没有在URL中使用 me .我的凭据现在无效,因此无法对其进行测试.您链接的答案中似乎有一个错误.

At least in a quick scan that looks like it's it, I wrote an auto-publisher for a client a year ago and it didn't use the me in the url. My credentials are invalid now, so can't test it unfortunately. It seems to be a bug in the answer you linked.

如果您能阅读其他语言,我发现遍历他们的SDK并转换代码会很有帮助:

If you can read other languages, I found it helpful just going through their SDKs and converting the code:

www.dailymotion/doc/api/sdk-php.html

github/dailymotion/dailymotion-sdk-php/blob/master/Dailymotion.php

更多推荐

远程服务器返回错误:(403)禁止.在发帖期间...?

本文发布于:2023-11-26 18:20:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1634668.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:发帖   错误   服务器

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!