How to get the status code of the response?
See original GitHub issueI do this but I have not found on how to get the status code of the response. How to get the status code of the response?
public sealed class WebReader
{
private IDocument _ashDocument;
public async Task Load(string Url)
{
IConfiguration config = Configuration.Default.WithDefaultLoader().WithJavaScript().WithCss();
_ashDocument = await BrowsingContext.New(config).OpenAsync(Url);
await Task.WhenAll(_ashDocument.Requests);
}
public IHtmlCollection<IElement> Images { get { return _ashDocument.QuerySelectorAll("img"); } }
public IHtmlCollection<IElement> Links { get { return _ashDocument.Links; } }
}
static void Main(string[] args)
{
WebReader wReader = new WebReader();
// HTTP Status code: 200
wReader.Load("http://blogs.msdn.com/b/dotnet/").Wait();
// HTTP Status code: 404
wReader.Load("http://httpbin.org/status/404").Wait();
Console.ReadKey();
}
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Response: status property - Web APIs - MDN Web Docs
The status read-only property of the Response interface contains the HTTP status codes of the response.
Read more >How to Get the Status Code of a Fetch HTTP Response in ...
Simply call the status property on the response object to get the status code. Thanks for reading! If you want to learn about...
Read more >HTTP response status codes - MDN Web Docs - Mozilla
HTTP response status codes indicate whether a specific HTTP request has been successfully completed. Responses are grouped in five classes:.
Read more >Check HTTP Response Status Codes | Matthew Edgar
For a basic one-by-one analysis of a page, you can use header check tool like REDbot. Enter the URL of the page you...
Read more >Get HTTP code from org.apache.http.HttpResponse
Use HttpResponse.getStatusLine() , which returns a StatusLine object containing the status code, protocol version and "reason".
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was looking for the same and found this thread is closed, was this implemented in 0.9.4? any example?
@bugproof and for anyone else wondering you can get the status on the document.