天天看点

[unity3d]unity跟.net进行http通信http 提交数据原理 客户端发送表代码:效果图:服务器端接受代码:服务器端效果图:

谈谈今天的学习感受,今天收获最大的就是解决了u3d向.net提交表单,然后.net服务器将接受过来的表单数据保存到sqlserver数据库中。unity3d中wwwform默认的是post提交的。

http 协议通过 url来获取和提交数据 。提交数据的方式 有两种,一种是get方法,一种是post方法。get一般用于告诉服务器把满足参数的数据发送给回来。

例如:get 的html代码如下:

<form action="search.php" method ="GET">  

    <username:<inputtypeinputtype="text"name="user"/><br>  

    <password:<inputtypeinputtype="password "name="pwd"/><br>  

     <input type="submit"value="login"/>  

</form >  

post一般是将数据发送给服务器,服务器将这些数据进行处理,比如说存储到数据库。

例如:post的html 代码如下:

<form action="login.php" method ="POST" >  

     其实区别就是提交的方式不一样,点击login按钮后,浏览器地址栏里分别显示如下:

       get方法url为:http://127.0.0.1/serach.php?user=hortor&pwd=123

       post方法url为:http://127.0.0.1

[unity3d]unity跟.net进行http通信http 提交数据原理 客户端发送表代码:效果图:服务器端接受代码:服务器端效果图:
[unity3d]unity跟.net进行http通信http 提交数据原理 客户端发送表代码:效果图:服务器端接受代码:服务器端效果图:

==================== 迂者 丁小未 CSDN博客专栏=================

Unity QQ群:858550         cocos2dx QQ群:280818155

====================== 相互学习,共同进步 ===================

需要工程文件的请留言!

本文转蓬莱仙羽51CTO博客,原文链接:http://blog.51cto.com/dingxiaowei/1366199,如需转载请自行联系原作者