吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1067|回复: 0
收起左侧

[求助] Restsharp 链接网站 返回错误,求大神支招

[复制链接]
xxflying 发表于 2022-9-19 23:40
我的代码:

RestClient restClient= new RestClient(BaseUrl);
            restClient.Timeout = 5000;
            restClient.FollowRedirects = false;
            RestRequest restRequest = new RestRequest(Method.POST);
            restRequest.AddHeader("Upgrade-Insecure-Requests", "1");
         
            restRequest.AddHeader("X-Requested-With", "XMLHttpRequest");
            restRequest.AddHeader("Accept-Encoding", "gzip, deflate");
            
            restRequest.AddHeader("Accept-Language", "zh-CN,zh-Hans;q=0.9");
            restRequest.AddHeader("Accept", "*/*");
            restRequest.AddHeader("accessToken", "");
            restRequest.AddHeader("origin", "http://s.appykt.com");
            restRequest.AddHeader("Content-Type", "application/x-www-form-urlencoded");
            restClient.UserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.28(0x18001c29) NetType/WIFI Language/zh_CN";
            AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.99 XWEB/3179 MMWEBSDK/201201 Mobile Safari/537.36 MMWEBID/2493 MicroMessenger/8.0.1.1841(0x2800015D) Process/toolsmp WeChat/arm64 Weixin NetType/4G Language/zh_CN ABI/arm64";
            restRequest.AddHeader("Referer", "http://s.appykt.com/zld/uc/jump?target=userpay&gid=0&code=021b6E000f6xzO1zcw200dryVT3b6E05&state=123");
            restRequest.AddHeader("Referer", "http://s.appykt.com/zld/toaddcar?from=ucpay");
            restRequest.AddHeader("Host", "s.appykt.com");
            restRequest.AddHeader("Connection", "Keep-Alive");
            IRestResponse restResponse = restClient.Execute(restRequest);
            string con = restResponse.Content;
            Console.WriteLine(con);
            Console.WriteLine(restResponse.Content);
         
            RestClient restClient2 = new RestClient("http://s.appykt.com/zld/query_price?id=1663295540577656&parkid=1309540006&q_type=1&intime=1663295531&channel_id=");
     carnumber=%E5%B7%9DB913BD&from=ucpay");
            restClient2.Timeout = 5000;
            RestRequest restRequest2 = new RestRequest(Method.POST);
            string value = "carnumber=" + HttpUtility.UrlEncode(carId) + "&from=0";
            Console.WriteLine(value);
            restRequest2.AddParameter("application/x-www-form-urlencoded", value, ParameterType.RequestBody);
            IRestResponse restResponse2 = restClient2.Execute(restRequest2);
            string content = restResponse2.Content;
            Console.WriteLine(content);
            Console.ReadKey();

手机抓包:Host: s.appykt.com
Accept: */*
X-Requested-With: XMLHttpRequest
Accept-Language: zh-CN,zh-Hans;q=0.9
Accept-Encoding: gzip, deflate
accessToken:
Content-Type: application/x-www-form-urlencoded
Origin: http://s.appykt.com
Content-Length: 36
User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.28(0x18001c29) NetType/WIFI Language/zh_CN
Referer: http://s.appykt.com/zld/toaddcar?from=ucpay
Connection: keep-alive
Cookie: trace_id=5450d34f-acfa-46cd-ba4e-edc0f21a0c67; uc_userid=oVHXC1YaKEwaqYDMGJdX6fe5K6Ac; userid=oVHXC1YaKEwaqYDMGJdX6fe5K6Ac; SESSION=323dff9b-cf43-4c89-8e95-ddd46c1b52a8; access_type=scan_center_pay; parkid=1309540006; ccb_userid=oVHXC1YaKEwaqYDMGJdX6fe5K6Ac
————————————————
版权声明:本文为CSDN博主「菜芯儿」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_45567896/article/details/126939605

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-25 07:18

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表