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<string> callback)
{
HttpBase.POST(URL + "/cumt/login", new KeyValuePair<string, string>[]
{
new KeyValuePair<string, string>("username", "student"), new KeyValuePair<string, string>("password", "000000"), new KeyValuePair<string, string>("softName", "Road_Risk"),new KeyValuePair<string, string>("areaNo", "4151012761")
}, ((request, response) =>
{
if (response.IsSuccess)
{
if (callback != null)
{
callback(response.DataAsText.Trim());
}
}
else
{
if (callback != null)
{
callback("Error");
}
}
response.Dispose();
}));
}
}