Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9124563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:36:01+00:00 2026-06-17T06:36:01+00:00

I am hitting a url using http post with certain parameters and upon hitting

  • 0

I am hitting a url using http post with certain parameters and upon hitting url a box appears which asks for username and password . For now i am pasting the url in browser and on entering it asks for username and password.

I want to do this using asp.net when i know how to send request to url but i want to know how can i automatically enter username and password using code . Thank You

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:36:02+00:00Added an answer on June 17, 2026 at 6:36 am

    What you are looking to do is send a POST request to the server with the username and password. Most servers will not accept a direct authentication request and will require to have a few Http headers like cookies, referer to be set before it.

    You can use a tool like fiddler to see what your browser is actually sending to the server.

    Here is a small sample to send post data to the server.

    // create the POST request
    var postParams = "user=userName&password=userPassword";
    var webRequest = (HttpWebRequest)WebRequest.Create(yourUrl);
    webRequest.Method = "POST";
    webRequest.ContentType = "application/x-www-form-urlencoded";
    webRequest.ContentLength = postParams.Length;
    
    // send POST data
    using (StreamWriter sw = new StreamWriter(webRequest.GetRequestStream()))
    {
        sw.Write(postParams);
    }
    

    EDIT: This is this simplest method to set the basic authorization header

    webRequest.Credentials = new NetworkCredential("userName", "userPassword");
    

    The link you provide says that they use basic HTTP authentication.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My java program is hitting http://url:port kind of url to fetch some data. On
I've got a URL and I'm using HTTP GET to pass a query along
I am using worklight adapter as http adapter and i am htting on url
am using asynchronous task for hitting the web service url and retrieve the result
Is there a way to tell what code is returned by hitting a url?
I'm hitting what appears (to me) strange behavior when I pull data from the
<EDIT> The issue was related to passing arrays via GET and hitting the URL
I've started using a WebRequest to retrieve a file from a given URL. If
I'm using a shared webserver on which I can manage FTP accounts. I'm wondering
I am hitting a struts action using AJAX, everything is fine but there is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.