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();
}));
}
}
