美文网首页
5.31从内网请求数据

5.31从内网请求数据

作者: 胤醚貔貅 | 来源:发表于2017-05-31 19:26 被阅读97次

usingUnityEngine;

usingSystem.Collections;

usingUnityEngine.Networking;

usingSystem.Collections.Generic;

publicclassPostStr:MonoBehaviour{

//http://192.168.10.10:8080/users

string url="http://192.168.10.10:8080/users";

//username=zhangsan  pwd=123456

voidStart( ){

StartCoroutine("Post_Login");

}

voidUpdate( ){

}

IEnumeratorPost_Login( ){

//1.

//List<IMultipartFormSection>formData=newList<IMultipartFormSection>( );

//formData.Add(new MultipartFormDataSection("username","zhangsan"));

//formData.Add(new MultipartFormDataSection("psd","123456"));

//formData.Add(new MultipartFormDataSection("username=zhangsan","psd==123456"));

//2.

//WWWForm form=new  WWWForm();//要传给服务器的参数

//form.AddField("username","zhangsan");

//form.AddField("pwd","123456");

//form.AddBinaryData( );//上传图片给服务器

//WWWwww=newWWW(url,form);

//3.

Dictionary<string,string>dic=new Dictionary<string,string>( );

dic.Add("username","zhangsan");

dic.Add("pwd","123456");

UnityWebRequest wr=UnityWebRequest.Post(url,dic);

wr.downloadHandler=new DownloadHandlerBuffer();

yield return wr.Send();

//UnityWebRequestwr=UnityWebRequest.Post(url,form);

//wr.downloadHandler=newDownloadHandlerBuffer();

//yieldreturnwr.Send();

if(!wr.isError){

print(wr.downloadHandler.text);

}

}

}

相关文章

  • 5.31从内网请求数据

    usingUnityEngine; usingSystem.Collections; usingUnityEngi...

  • css工程问题

    这种写法在内网环境下无法使用。相当于在内网请求外网数据。 2.el-menu中background-color只能...

  • MQTT-CLIENT使用TIME-OUT问题

    内网连内网的MQTT-SERVER。client使用 连接内网server时总是超时,抓包发现没有请求发送。tel...

  • PHP编程指南(三)Get、Post表单处理

    获取表单数据需要使用PHP超级元组: $_GET从get请求中检索数据 $_POST从post请求中检索数据 GE...

  • Springboot实现跨域

    为了实现内网穿透,使用的frp。 请求链路:localhost前端—>云端服务器—>经frp穿透内网到localh...

  • get请求与post请求的区别

    get 请求 从指定的资源请求数据 post请求 向指定的资源提交要被处理的数据 二者区别

  • NATAPP内网穿透工具的使用教程

    内网穿透: 内网穿透简单来说就是将内网外网通过natapp隧道打通,让内网的数据让外网可以获取。 项目场景: 在本...

  • 【GO】http请求超时的问题排查

    http请求超时的问题排查 问题描述 背景:生产环境中,服务间内网http调用,偶现超时。由于内网调用,网络开销理...

  • Flask实现异步非阻塞接口

    背景:工作中有一需求,需要请求外部JiRa(类似数据库吧),将请求数据进行分析,从请求到获取数据需要20s,由于这...

  • 从网络请求数据

    NSURL 这是最最基础的类,访问网络资源离不开它,它有不少很有用的方法,比如从字符串创建一个URL。还有创建一个...

网友评论

      本文标题:5.31从内网请求数据

      本文链接:https://www.haomeiwen.com/subject/bwvjfxtx.html