Unity3d之Http通讯GET方法和POST方法
来源:互联网 发布:租赁市场知乎 编辑:程序博客网 时间:2024/06/05 12:43
(一)GET方法
IEnumerator SendGet(string _url) { WWW getData = new WWW(_url); yield return getData; if(getData.error != null) { Debug.Log(getData.error); } else { Debug.Log(getData.text); } }
(二)POST方法
IEnumerator SendPost(string _url, WWWForm _wForm) { WWW postData = new WWW(_url, _wForm); yield return postData; if (postData.error != null) { Debug.Log(postData.error); } else { Debug.Log(postData.text); } }
调用两个方法
public void TestHttpSend() { //测试GET方法 StartCoroutine(SendGet("http://kun.show.ghostry.cn/?int=5")); //测试POST方法 WWWForm form = new WWWForm(); form.AddField("int", "6"); StartCoroutine(SendPost("http://kun.show.ghostry.cn/", form)); }
0 0
- Unity3d之Http通讯GET方法和POST方法
- Http之get方法和post方法介绍
- Http之get方法和post方法介绍
- 安卓HTTP请求之get和post方法。
- Http方法 GET/POST
- http:get&post方法
- HTTP中GET,POST方法之区别
- HTTP中GET,POST方法之区别
- HTTP中GET,POST方法之区别
- http 中的post和get方法
- Http的get和post方法比较
- HTTP方法 get和post区别
- HTTP中GET和POST方法异同
- telnet模拟http GET和POST方法
- http中get和post的方法
- HTTP协议中的GET和POST方法
- HTTP 方法GET 和 POST区别
- HTTP方法:GET和POST区别
- 我是如何向老婆解释MapReduce的?
- hive常用属性设置
- Http协议学习笔记
- Java主函数参数不同形式的辨析
- 物理读&逻辑读&即时读&一致读&读一致性
- Unity3d之Http通讯GET方法和POST方法
- VB源代码
- 关于docker build时间过久及add不能跨文件的问题
- 使用特定字符串代替源字符串中空格
- 这是我的第一篇正式博客
- 反转链表
- 【自考】考后总结
- 何时开始使用自动化测试
- Oracle in与exists