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 7698165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:10:43+00:00 2026-05-31T22:10:43+00:00

I believe I’ve done this before, but I can’t seem to remember how:( HttpWebRequest

  • 0

I believe I’ve done this before, but I can’t seem to remember how:(

        HttpWebRequest request = (HttpWebRequest)WebRequest.Create("www.example.com");
        request.Method = "GET";
        HttpWebResponse response = (HttpWebResponse)request.GetResponse();

How do I then write the response to the page?

Thanks a lot.

  • 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-05-31T22:10:44+00:00Added an answer on May 31, 2026 at 10:10 pm

    The below example demonstrates how it can be done:

    string myRequest = "abc=1&pqr=2&lmn=3";
    string myResponse="";
    string myUrl = "Where you want to post data";
    System.IO.StreamWriter myWriter = null;// it will open a http connection with provided url
    System.Net.HttpWebRequest objRequest = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(myUrl);//send data using objxmlhttp object
    objRequest.Method = "GET";
    objRequest.ContentLength = TranRequest.Length;
    objRequest.ContentType = "application/x-www-form-urlencoded";//to set content type
    myWriter = new System.IO.StreamWriter(objRequest.GetRequestStream());
    myWriter.Write(myRequest);//send data
    myWriter.Close();//closed the myWriter object
    
     System.Net.HttpWebResponse objResponse = (System.Net.HttpWebResponse)objRequest.GetResponse();//receive the responce from objxmlhttp object 
    using (System.IO.StreamReader sr = new System.IO.StreamReader(objResponse.GetResponseStream()))
        {
          myResponse= sr.ReadToEnd();
        }
    

    Then u can use the data in myResponse to display whatever is returned.
    Hope this helps you…

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

Sidebar

Related Questions

I believe this has been answered before but how can I have buttons /
I believe this is possible but I haven't done it before. I need to
I believe this has been asked before but no concrete answer has been determined.
I believe lot of people already asked this question before, but i kept getting
I believe this is trivial, but I can't for the life of me, figure
I believe this is possible but unsure how to go around it, I need
I believe this question is slightly different than similar ones asked on here before
(I believe this is the same problem as this one , but there's no
I believe that the main thread cannot die before the child thread. But is
Believe it or not, I have searched the internet before asking this question. Unbelievably,

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.