新浪微薄接口《发布一条微博信息(2/statuses/update )》接口怎么使用,请高手给出相应demo,小弟在线等
解决方案 »
- Ajax动态生成控件问题
- 有没有什么控件能直接生成柱形图,曲线图的呢
- 请问怎么实现asp.net中只打印web窗体中的某一个table中的内容,并且保持table内格式不变?
- webBrowser为什么获得不到JS中的值
- 帮忙看下!这两段程序有什么不同!急!
- .net怎么移植啊?
- 我看一些aspx网页里代码只有一个函数如:<%NavList(5);%>,我不清楚的是,执行这个函数后,页面代码是怎么传回的?
- 外部控件的导入问题
- 使用存储过程插入数据库出错,菜鸟勿进(以减轻CSDN服务器负担).
- 我有一个C/S的小程序,要在B/S上用到它,两者怎么结合起来呢?
- asp.net语法问题
- 我的查询怎么查不到
var httpWebRequest2 = System.Net.WebRequest.Create("https://api.weibo.com/2/statuses/update.json") as HttpWebRequest; ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(CheckValidationResult); httpWebRequest2.Method = "POST";
httpWebRequest2.ServicePoint.Expect100Continue = false;
string responseData2 = string.Empty;
httpWebRequest2.ContentType = "application/x-www-form-urlencoded"; string param = "access_token=" + _outhToken + "&status=" + HttpUtility.UrlEncode(Content); Stream requestWriter = httpWebRequest2.GetRequestStream();
try
{
requestWriter.Write(Encoding.ASCII.GetBytes(param), 0, Encoding.ASCII.GetBytes(param).Length);
}
finally
{
requestWriter.Close();
}
try
{
Log.InfoFormat("_outhToken is {0}", _outhToken);
var responseReader2 = new StreamReader(httpWebRequest2.GetResponse().GetResponseStream());
responseData2 = responseReader2.ReadToEnd();
Log.Info(responseData2);
}
catch (Exception ex)
{
Response.Write(ex);
}
var httpWebRequest2 = System.Net.WebRequest.Create("https://api.weibo.com/2/statuses/update.json") as HttpWebRequest; ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(CheckValidationResult); httpWebRequest2.Method = "POST";
httpWebRequest2.ServicePoint.Expect100Continue = false;
string responseData2 = string.Empty;
httpWebRequest2.ContentType = "application/x-www-form-urlencoded"; string param = "access_token=" + _outhToken + "&status=" + HttpUtility.UrlEncode(Content); Stream requestWriter = httpWebRequest2.GetRequestStream();
try
{
requestWriter.Write(Encoding.ASCII.GetBytes(param), 0, Encoding.ASCII.GetBytes(param).Length);
}
finally
{
requestWriter.Close();
}
try
{
Log.InfoFormat("_outhToken is {0}", _outhToken);
var responseReader2 = new StreamReader(httpWebRequest2.GetResponse().GetResponseStream());
responseData2 = responseReader2.ReadToEnd();
Log.Info(responseData2);
}
catch (Exception ex)
{
Response.Write(ex);
}
不知道哪里写错了,总是报403错误