Home > Net >  C # bosses look at this url. Httprequest access
C # bosses look at this url. Httprequest access

Time:10-12

Httprequest couldn't grab the page in https://www.hotels.com/application, but through the webbrowser,

Solving, tried many ways to get cookie put them through the webbrowser httprequest inside will not work

CodePudding user response:

Is unable to grab return null or an error? What tips?

CodePudding user response:

Httprequest cannot handle things too much, it can only catch a static page
Js rendering, jump, and so on can't grab

CodePudding user response:

reference 1st floor from ning response:
can't grab is returned empty, or an error? What tips?
return not enough permissions (not on landing permissions), he is the first visit will be to be cookies to write something,

CodePudding user response:

refer to the second floor stherix response:
httprequest cannot handle things too much, it can only catch a static page
Js rendering, jump, and so on can't grab
I just want to simulate his HTTP requests, submit, but with the postman these access is no problem,

CodePudding user response:

Postman can use code that can be

CodePudding user response:

reference 5 floor stherix reply:
postman can use the code can also
yeah so can't find the reason,

CodePudding user response:

You could see the Postman after the request is successful, the response in the top right-hand corner of the place has a code, that there are some parameters, see and your program is same, can have a try

CodePudding user response:

Should be to add a request Header

CodePudding user response:

Now that the postman can,
You will compare the postman send the request to carry all the things,

CodePudding user response:

This visit has redirected to time should be after the redirection address,

CodePudding user response:

HttpClient, use this,


 HttpClient HttpClient=new HttpClient (); 
HttpClient. GetAsync (url). The Result. Content. ReadAsStringAsync ();

CodePudding user response:

The Request URL: https://www.hotels.com/
The Request Method: GET
The Status Code: 302
Remote Address: 23.42.184.253:443

This has been redirected, webRequest, add a myRequest. AllowAutoRedirect=true;
Have a try
  • Related