天天蘑菇通知
This commit is contained in:
@@ -389,55 +389,55 @@ namespace Hncore.Pass.Vpn.Service
|
||||
public override async Task<ApiResult> Refund(string account, string packageKey, int days)
|
||||
{
|
||||
|
||||
var infoRet = await this.GetAccountInfo(account);
|
||||
// Console.WriteLine(infoRet.ToJson());
|
||||
// await Task.Delay(50);
|
||||
var id = infoRet.Data.Id;
|
||||
// var infoRet = await this.GetAccountInfo(account);
|
||||
// // Console.WriteLine(infoRet.ToJson());
|
||||
// // await Task.Delay(50);
|
||||
// var id = infoRet.Data.Id;
|
||||
|
||||
//{"DefaultRequestHeaders":[{"Key":"hl","Value":["hl"]},{"Key":"Cookie","Value":["EtV1DHm0lJwaH9n4dhKUOIGSO8XKroVSRY7shrgFTJyzk3hANqLsVoiYAIzDR8M7"]},{"Key":"Authorization","Value":["Bearer EtV1DHm0lJwaH9n4dhKUOIGSO8XKroVSRY7shrgFTJyzk3hANqLsVoiYAIzDR8M7"]}],"BaseAddress":"http://xjip.hlapi.com/","Timeout":"00:01:40","MaxResponseContentBufferSize":2147483647}
|
||||
// var client = CreateHttpClient();
|
||||
// var get_token = client.DefaultRequestHeaders.GetCookies()[0].Cookies[0].Name;
|
||||
// //{"DefaultRequestHeaders":[{"Key":"hl","Value":["hl"]},{"Key":"Cookie","Value":["EtV1DHm0lJwaH9n4dhKUOIGSO8XKroVSRY7shrgFTJyzk3hANqLsVoiYAIzDR8M7"]},{"Key":"Authorization","Value":["Bearer EtV1DHm0lJwaH9n4dhKUOIGSO8XKroVSRY7shrgFTJyzk3hANqLsVoiYAIzDR8M7"]}],"BaseAddress":"http://xjip.hlapi.com/","Timeout":"00:01:40","MaxResponseContentBufferSize":2147483647}
|
||||
// // var client = CreateHttpClient();
|
||||
// // var get_token = client.DefaultRequestHeaders.GetCookies()[0].Cookies[0].Name;
|
||||
|
||||
HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://xjip.hlapi.com/api/number/refund");
|
||||
// HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://xjip.hlapi.com/api/number/refund");
|
||||
|
||||
req.Method = "DELETE";
|
||||
// req.Method = "DELETE";
|
||||
|
||||
req.ContentType = "application/x-www-form-urlencoded";
|
||||
req.Headers.Add("Authorization", "Bearer w1v9MjG58z6qEzKPUVAdyhRBM8h1vYZVAGc4YpGx525APv9YHQPKuxVMt5EpF87A");
|
||||
// req.ContentType = "application/x-www-form-urlencoded";
|
||||
// req.Headers.Add("Authorization", "Bearer w1v9MjG58z6qEzKPUVAdyhRBM8h1vYZVAGc4YpGx525APv9YHQPKuxVMt5EpF87A");
|
||||
|
||||
req.Timeout = 30000;//请求超时时间
|
||||
// req.Timeout = 30000;//请求超时时间
|
||||
|
||||
|
||||
|
||||
var postData = "id=" + id;
|
||||
// var postData = "id=" + id;
|
||||
|
||||
byte[] data = Encoding.UTF8.GetBytes(postData);
|
||||
// byte[] data = Encoding.UTF8.GetBytes(postData);
|
||||
|
||||
req.ContentLength = data.Length;
|
||||
// req.ContentLength = data.Length;
|
||||
|
||||
|
||||
|
||||
using (Stream reqStream = req.GetRequestStream())
|
||||
{
|
||||
reqStream.Write(data, 0, data.Length);
|
||||
// using (Stream reqStream = req.GetRequestStream())
|
||||
// {
|
||||
// reqStream.Write(data, 0, data.Length);
|
||||
|
||||
reqStream.Close();
|
||||
}
|
||||
// reqStream.Close();
|
||||
// }
|
||||
|
||||
|
||||
Console.WriteLine(postData);
|
||||
// Console.WriteLine(postData);
|
||||
|
||||
|
||||
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
|
||||
// HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
|
||||
|
||||
Stream stream = resp.GetResponseStream();
|
||||
// Stream stream = resp.GetResponseStream();
|
||||
|
||||
string result = "";
|
||||
//获取响应内容
|
||||
using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
|
||||
{
|
||||
result = reader.ReadToEnd();
|
||||
}
|
||||
// string result = "";
|
||||
// //获取响应内容
|
||||
// using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
|
||||
// {
|
||||
// result = reader.ReadToEnd();
|
||||
// }
|
||||
|
||||
return new ApiResult(1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user