WebClient发送POST请求
2016-05-13 15:19
176 查看
string postData = "client_id="+ Sina.APP_ID +"&client_secret="+ Sina.APP_KEY +"&grant_type=authorization_code&redirect_uri="+ Sina.RedirectUrl +"&code="+code;
byte[] bytes = Encoding.UTF8.GetBytes(postData);
WebClient client = new WebClient();
client.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
client.Headers.Add("ContentLength", postData.Length.ToString());
byte[] responseData = client.UploadData("https://api.weibo.com/oauth2/access_token", "POST", bytes);
byte[] bytes = Encoding.UTF8.GetBytes(postData);
WebClient client = new WebClient();
client.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
client.Headers.Add("ContentLength", postData.Length.ToString());
byte[] responseData = client.UploadData("https://api.weibo.com/oauth2/access_token", "POST", bytes);
相关文章推荐
- iOS歌词渐变的实现
- 图解Tomcat类加载机制
- Windows下搭建React Native Android开发环境
- as下git 操作
- centos7安装mysql5.x
- 八数码(康托展开)
- apache httpcompontens之HttpAsyncClient使用
- maven插件入门学习中碰到的问题解决
- windows下安装redis
- 用MediaRecoder类进行录制视频
- docker入门实战笔记
- svn提交报错:svn: Aborting commit:XXXXXremains in conflict
- javascript判断图片是否加载完成的方法推荐
- C语言第三次课
- VM扩展名类型
- 碰撞检测(上篇)
- 概要设计、详细设计:概念、方法、实践步骤
- 窗口类、窗口类对象与窗口 三者之间关系
- 得到屏幕的宽和高,然后在代码里面设置控件的宽和高,加载gif图片
- 实验三 进程调度模拟程序