elcattivo/CloudFlareUtilities

HttpWebRequest instead of httpclient

gmareater opened this issue · 3 comments

hi
Thanx for your work,

Is there any way to use HttpWebRequest instead of httpclient?
could you provide sample?

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.

  1. Add a CookieContainer to your request
  2. Add a Client-Header to your request
  3. Get the response and check if the JS-challenge is present
  4. Solve the JS-challenge using the ChallengeSolver-class
  5. Build the clearance URL using the solution and request it
  6. Add the cookies provided by the clearance page to your original request
  7. 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.

thanx for your tips, I willl give it a try :)

hi
It worked, i just make _cookie field ,"Public", and replace my own cookie container
I'm so Happy :))

Thanx dude