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

  • Home
  • SEARCH
  • 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 4619674
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:27:23+00:00 2026-05-22T02:27:23+00:00

I’m trying to send a GET request using HttpWebRequest. I’ve found a lot of

  • 0

I’m trying to send a GET request using HttpWebRequest.
I’ve found a lot of examples all over the web (for example, this one…just go down to the Scrape() method). They all basically do the same thing:

Create a HttpWebRequest object by using WebRequest.Create(URL) and casting it to HttpWebRequest, then getting the response by using the GetResponse() method from HttpWebRequest.

Thing is, GetResponse() doesn’t seem to exist in either HttpWebRequest or WebRequest (which is its base class). My only option is to use BeginGetResponse().

The only thing I found is that GetResponse() is synchronous, while BeginGetResponse() is asynchronous, and that Silverlight only allows the asynchronous one. Well, that doesn’t help me at all, since the whole thing is an XNA project, and this is a simple C# class I created inside.
Well to be more accurate, this is a Windows Phone game, created in XNA 4.0

HttpWebRequest webRequest = WebRequest.Create(URL) as HttpWebRequest; 
StreamReader responseReader = new StreamReader( 
         webRequest.GetResponse().GetResponseStream());

Does anyone have any idea as to why I don’t have GetResponse()?

  • 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-22T02:27:23+00:00Added an answer on May 22, 2026 at 2:27 am

    XNA 4 for Windows Phone 7 can only make asynchronous calls. You might find the code at the bottom of this post helpful as well.

    Code from that post:

    protected override void Initialize()
    {
        string webServiceAddress = @"http://localhost/service/service1.asmx";           
        string methodName = "HelloWorld";
    
        string webServiceMethodUri = string.Format("{0}/{1}", webServiceAddress, methodName);
    
        HttpWebRequest httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(webServiceMethodUri);
        httpWebRequest.Method = "POST";
    
        httpWebRequest.BeginGetResponse(Response_Completed, httpWebRequest);
    
        base.Initialize();
     }
    
     void Response_Completed(IAsyncResult result)
     {
        HttpWebRequest request = (HttpWebRequest)result.AsyncState;
        HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(result);
    
        using (StreamReader streamReader = new StreamReader(response.GetResponseStream()))
        {
            string xml = streamReader.ReadToEnd();
    
            using(XmlReader reader = XmlReader.Create(new StringReader(xml)))
            {
                 reader.MoveToContent();
                 reader.GetAttribute(0);
                 reader.MoveToContent();
                 message = reader.ReadInnerXml();
            }
        }
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am trying to loop through a bunch of documents I have to put
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm making a simple page using Google Maps API 3. My first. One marker
I have some data like this: 1 2 3 4 5 9 2 6
I have a bunch of posts stored in text files formatted in yaml/textile (from

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.