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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

POSTing to a website but no response wanted.

Status
Not open for further replies.

basil3legs

Programmer
Jun 13, 2002
157
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 want!
        responseReader = New IO.StreamReader(webRequest.GetResponse.GetResponseStream)
       
        Dim responseData As String
        Dim strData As String

        responseData = responseReader.ReadToEnd
        responseReader.Close()
        strData = responseData
 
Ah! Sorry, wrong forum - this is VB 2005! Will post there instead.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top