您当前的位置: 首页 >  云小川 unity

unity 对接 后台登录(http)

云小川 发布时间:2022-09-29 10:59:52 ,浏览量:11

 BestHTTPBestHTTPBestHTTP-C#文档类资源-CSDN文库

using BestHTTP;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class HttpTest : MonoBehaviour
{
    public string URL = "http://10.0.0.88:6001";
    void Start()
    {
        Login_UserPwd((s) => {
            Debug.Log(s);
        });
    }

    public void Login_UserPwd( Action callback)
    {
        HttpBase.POST(URL + "/cumt/login", new KeyValuePair[]
        {
            new KeyValuePair("username", "student"), new KeyValuePair("password", "000000"), new KeyValuePair("softName", "Road_Risk"),new KeyValuePair("areaNo", "4151012761")
        }, ((request, response) =>
        {
            if (response.IsSuccess)
            {
                if (callback != null)
                {
                    callback(response.DataAsText.Trim());
                }
            }
            else
            {
                if (callback != null)
                {
                    callback("Error");
                }
            }
            response.Dispose();
        }));
    }
}

关注
打赏
1688896170
查看更多评论

云小川

暂无认证

  • 11浏览

    0关注

    60博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.0381s