HttpWebRequest instead of httpclient
gmareater opened this issue · 3 comments
gmareater commented
hi
Thanx for your work,
Is there any way to use HttpWebRequest instead of httpclient?
could you provide sample?
elcattivo commented
Sorry, but I'm not aware of a simple method to use this library together with HttpWebRequest
. You basically have to manually do all the steps that happen inside the ClearanceHandler
.
- Add a
CookieContainer
to your request - Add a Client-Header to your request
- Get the response and check if the JS-challenge is present
- Solve the JS-challenge using the
ChallengeSolver
-class - Build the clearance URL using the solution and request it
- Add the cookies provided by the clearance page to your original request
- Repeat your original request
This list is maybe not complete, but that is more or less, what the ClearanceHandler
normally would to for you. At least you can make use of the ChallengeSolver
.
gmareater commented
thanx for your tips, I willl give it a try :)
gmareater commented
hi
It worked, i just make _cookie field ,"Public", and replace my own cookie container
I'm so Happy :))
Thanx dude