question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

inject Cookies to AngleSharp

See original GitHub issue

I need AngleSharp read a cookie session to get open a secure website, i try this but it is not working.

req.Credentials = new NetworkCredential("user", "pass","domain");
var response = (HttpWebResponse)request.GetResponse();
var statusCode = response.StatusCode;
if (statusCode == HttpStatusCode.OK)
{
    var configuration = Configuration.Default.WithCookies().WithDefaultLoader();
    var context = BrowsingContext.New(configuration);
   await context.OpenAsync(url);
}

But i obtain 401(not authorised) from server. How can i achieve this?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
pkudrelcommented, Mar 20, 2017

WithRequesters is an extension in AngleSharp.Io package.

0reactions
NorDroNcommented, Mar 20, 2017

THNX, but unfortunately it’s supporting only net45 now. I hope it’ll be fixed soon - https://github.com/AngleSharp/AngleSharp.Io/issues/9

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding a cookie to DocumentRequest - anglesharp
I think there are two potential ways to solve this. either use document.Cookie for setting a new cookie (would require an active document ......
Read more >
How to use cookies in AngleSharp? : r/csharp
I got my cookies from Chrome (by running the JavaScript code `document.cookie`). How to use this cookie string in AngleSharp?
Read more >
How to set Cookies from AngleSharp into WebClient ...
Hey, I have to download some .exe Files from a server but as I have read, anglesharp is not able to do this....
Read more >
Programmatic web page login with cookies - Damir's Corner
If a site requires you to include hidden fields from the login page, you need to request that page first and parse the...
Read more >
AngleSharp.Io 1.0.0
AngleSharp.Io extends AngleSharp with powerful requesters, caching mechanisms, and storage systems. It is coupled more strongly to the underlying operating ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found