Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

POSTing with requestWriter but not wanting a response

Status
Not open for further replies.

basil3legs

Programmer
Joined
Jun 13, 2002
Messages
157
Location
GB
I am using requestWriter to post to a website but as it takes ages for a response to come back, is there any way of sending the data and leaving it at that? I have tried removing the GetResponse parts but that doesn't seem to work. As the code stands (see below) it works fine but is too slow due to a delay at the web server.

Code:
strURL = "[URL unfurl="true"]http://the[/URL] relevent site and page.do"
        strPostData = "the POST data"
        webRequest = Net.WebRequest.Create(strURL)
        webRequest.Method = "POST"
        webRequest.ContentType = "application/x-[URL unfurl="true"]www-form-urlencoded"[/URL]

        'write the form values into the request message
        requestWriter = New IO.StreamWriter(webRequest.GetRequestStream)

        requestWriter.Write(strPostData)
        requestWriter.Close()

        'get the response from the server - which I don't need!
        responseReader = New IO.StreamReader(webRequest.GetResponse.GetResponseStream)
       
        Dim responseData As String
        Dim strData As String

        responseData = responseReader.ReadToEnd
        responseReader.Close()
        strData = responseData
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top