public async Task <HttpResult <T> > PutAsJsonAsync(string url, Stream stream, TaskInfo task)
        {
            var r = new HttpResult <T>();
            var c = new HclientContent(stream, task);

            try
            {
                var response = await PutAsync(url, c, task.cancelToken);

                r.success = response.IsSuccessStatusCode;
                r.ok      = true;
                if (r.success)
                {
                    r.body = response.Headers.ETag.Tag;
                }
                else
                {
                    r.body = await response.Content.ReadAsStringAsync();

                    var xml = new XmlDocument();
                    xml.LoadXml(r.body);
                    var err =
                        r.code = xml.SelectSingleNode("/Error/Code").InnerText;
                    r.message  = xml.SelectSingleNode("/Error/Message").InnerText;
                }
            }
            catch (Exception ex)
            {
                r.ok  = false;
                r.err = ex.Error();
            }
            return(r);
        }
        public async Task <HttpResult <T> > PostAsJsonAsync(string url, object data, TaskInfo task = null, bool redirect = false)
        {
            var c = new HclientContent(JsonConvert.SerializeObject(data), task);

            DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Instance.access_token);
            var r = new HttpResult <T>();

            try
            {
                var response = await PostAsync(url, c);

                r.success = response.IsSuccessStatusCode;
                r.body    = await response.Content.ReadAsStringAsync();

                r.obj     = JsonConvert.DeserializeObject <T>(r.body);
                r.code    = r.obj.code;
                r.message = r.obj.message;
                r.ok      = true;
                if (r.code == "AccessTokenInvalid")
                {
                    Console.WriteLine($"AccessToken过期[{redirect}]");
                    if (!redirect)
                    {
                        var re = await token.Instance.Refresh();

                        if (re.Yes)
                        {
                            return(await PostAsJsonAsync(url, data, task, true));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                r.err = ex.Error();
            }
            return(r);
        }