新浪微薄接口《发布一条微博信息(2/statuses/update )》接口怎么使用,请高手给出相应demo,小弟在线等

解决方案 »

  1.   

    大家帮我看看,这个代码什么地方有问题
     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);
                }
      

  2.   

     这样的效果吗?如果是直接贴下面的代码到对应的位置 <iframe width="100%" height="500"frameborder="0" scrolling="no" src="http://widget.weibo.com/livestream/listlive.php?language=zh_cn&width=0&height=500&uid=2310840190&skin=1&refer=1&pic=1&titlebar=1&border=1&publish=1&atalk=1&recomm=0&at=0"></iframe>
      

  3.   

    可以看新浪微博的开发文档http://open.weibo.com/wiki/index.php/API%E6%96%87%E6%A1%A3
      

  4.   

    文档我都看过了,写了这样的代码
    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错误