in Education by
I need to check if url exists and can be reached. In order to do it I send Get request and handle the status: var httpClient = new HttpClient(); var response = httpClient.GetAsync(new Uri(pageUrl)); isPageAccessible = response.Result.StatusCode == HttpStatusCode.OK; However, the server uses NTLM for authentication. As I found it here, there are several steps (requests) before I get success OK status. For the first request I get 401 Unauthorized status and can't go to further steps. All in all, how can I check url on the server with NTML upon completion of all requests? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
If you are accessing an authenticated server, you should provide credentials. Credentials of running process for NTLM can be provided with HttpClient as below: var handler = new HttpClientHandler { Credentials = System.Net.CredentialCache.DefaultCredentials }; var httpClient = new HttpClient(handler); var response = httpClient.GetAsync(new Uri(pageUrl));

Related questions

0 votes
    We have a SQUID reverse proxy and a MOSS 2007 portal. All sites are using NTLM. We cannot get it ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    I'm using the following in the web page but can't get a response from the server while it's ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    I'm using the following in the web page but can't get a response from the server while it's ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    Can one make an angular application to render on the server-side?...
asked Jun 30, 2021 in Education by JackTerrance
0 votes
    Is it possible to maintain sessions in REST on the server-side? 1. No 2. Yes 3. Depends on situation 4. I don’t know...
asked Jun 24, 2021 in Technology by JackTerrance
0 votes
    The two types of Service Discovery includes Client-side discovery and server-side discovery. A. True B. False...
asked Jan 11, 2023 in Technology by JackTerrance
0 votes
    I am using datatable with Laravel to order a response that i receive from an API I connect to the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    Which class provides system independent server side implementation? (a) Socket (b) ServerSocket (c) Server (d) ... Servlet of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
0 votes
    Is it possible to remove ( not hide using display:none ) some part of HTML from source for mobile ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 15, 2022 in Education by JackTerrance
0 votes
    Which class provides system independent server side implementation? (a) Socket (b) ServerSocket (c) Server ( ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Difference between Server-Side AJAX framework and Client-side AJAX framework?...
asked Dec 31, 2020 in Technology by JackTerrance
0 votes
    Which of the following is correct Content-type header that a server side script should send for SSE in HTML5? A - Content- ... Content-Type: text/data-stream D - None of the above....
asked Dec 2, 2020 in Technology by JackTerrance
0 votes
    Which of the following is correct about Server Side Events(SSE) in HTML5? A - To use Server-Sent Events in a web ... of sending event data consistently. D - All of the above....
asked Dec 2, 2020 in Technology by JackTerrance
...