using Newtonsoft.Json; using System; using System.Collections; using System.Collections.Generic; using System.Threading.Tasks; using UnityEngine; //8.4查看地址详情 public class areaInfo84 : MonoBehaviour { public AdressInfoResponse adressInfoResponse; public async Task AdressInfo(int areaId) { // 准备请求的头部信息,包含授权令牌 Dictionary head84 = new Dictionary { { "Authorization", Global.global.serverResponse.data.token } }; // 异步发送请求 string response84 = await web.SendRequest(web.URL + "/snail/area/queryInfo?areaId=" + areaId, "GET", "{}", head84); // 调试输出接收到的响应 Debug.Log("8.4地址详情====================: " + response84); // 将响应反序列化为 AdressInfoResponse 对象 try { adressInfoResponse = JsonConvert.DeserializeObject(response84); } catch (Exception ex) { Debug.LogError("反序列化响应失败: " + ex.Message); } // 返回解析后的对象 return adressInfoResponse; } }