Unity Get和Post方法
来源:互联网 发布:js对象定义 编辑:程序博客网 时间:2024/06/06 01:54
IEnumerator Get(string url, Dictionary<string, string> getData) { string param = null; //生成参数 if (getData != null) { param = "?"; int count = getData.Count; int index = 0; foreach (KeyValuePair<string, string> kvp in getData) { if (index < count - 1) { param += kvp.Key + "=" + kvp.Value + "&"; } else { param += kvp.Key + "=" + kvp.Value; } index++; } } //将参数转换成url编码 param = WWW.EscapeURL(param); WWW www = new WWW(url + param); yield return www; if (!string.IsNullOrEmpty(www.error)) { Debug.Log(www.error); } else { Debug.Log(www.text); } }
IEnumerator Post(string url, Dictionary<string, string> postData) { WWWForm wwwForm = new WWWForm(); foreach (KeyValuePair<string, string> kvp in postData) { wwwForm.AddField(kvp.Key, kvp.Value); } WWW www = new WWW(saveUrl, wwwForm); yield return www; if (!string.IsNullOrEmpty(www.error)) { Debug.Log(www.error); } else { Debug.Log(www.text); } }
0 0
- Unity Get和Post方法
- get和post方法
- get方法和post方法
- POST方法 和 GET方法
- get和post方法区别
- jQuery get() 和 post() 方法
- get和post方法区别
- AJAX get() 和 post() 方法
- axios Get和POST方法
- GET方法和POST方法的区别
- GET方法和POST方法的区别
- GET方法和POST方法的区别
- Get方法和Post方法的区别
- GET方法和POST方法的区别
- Get方法和Post方法的区别
- [HTML]POST方法和GET方法
- GET方法和POST方法的区别
- 对比get方法和post方法?
- c++ — 实现一个简单的string类
- margin经常使用的场景(一)
- mybatis插入大于号小于号到oracle
- 最简SDL显示视频实例
- eclipse自动编译设置
- Unity Get和Post方法
- Hive安装部署
- 通过adbshell获取android的权限集合
- Item高度自适应内容
- 第二本书 错题
- 正确处理内存出错故障
- 维护嵌入式 Linux 内核——So Easy
- 骨牌铺方格 (sdut oj)
- 欢迎使用CSDN-markdown编辑器