Results 1 to 3 of 3

Thread: [RESOLVED] Make a Get Web Request

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2006
    Posts
    592

    Resolved [RESOLVED] Make a Get Web Request

    I need to make a single GET request using httpWebRequest class.

    I was wondering do i need to get response necessary or making only request is enough?

    Code:
    Dim req As HttpWebRequest = CType(WebRequest.Create("http://www.service.com/receiver.aspx?param=value&param2=value"), HttpWebRequest)
    or i have to get the response anyway?


    Btw, what is the default value of the HttpWebRequest Method? Is it Get or just nothing?

    EDIT: Response is necessary ! Thanks
    Last edited by selanec; Aug 8th, 2009 at 02:20 AM.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [RESOLVED] Make a Get Web Request

    Look in the comments of this page

    http://msdn.microsoft.com/en-us/libr...ebrequest.aspx

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2006
    Posts
    592

    Re: [RESOLVED] Make a Get Web Request

    It is pretty self-explanatory
    Code:
    // Create an HttpWebRequest using WebRequest.Create (see .NET docs)!
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
    
    // Execute the request and obtain the response stream
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            Stream responseStream = response.GetResponseStream();
    Means just saying webrequest.Create(uri) it does nothing

    Thanks for the reply it is much appreciated!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width