View Single Post
  #15 (permalink)  
Old 02-04-2010, 11:48 PM
konisek's Avatar
konisek konisek is offline
Knows the basics
 
Join Date: Jan 2009
Posts: 55
Default syncrhonous -> asynchronous call

I use the foolowing code:
Code:
Sub Button1_Click
....
response.New1
request.New1 (URL)
request.Method = 
"POST"
request.TimeOut = 
60000
request.ContentType = 
"application/x-www-form-urlencoded"

stream.New1(Request.GetStream,
True)
stream.WriteBytes(stream.StringToBytes(name))
response.Value = request.GetResponse

'reading cookie
regex.New1("PHPSESSID=.[a-zA-Z0-9]+")
match.New1
match.Value = 
regex.Match(response.Headers)
Session_ID = match.String

'Get the response into array
bin.New1(response.GetStream, True)
bit.New1
Dim buffer(1024As byte
count = bin.ReadBytes(buffer(),
1024)
For i = 0 To ArrayLen(buffer())-1
retezec = retezec & 
" " & buffer(i)
Next 
Msgbox(retezec)

'operations with buffer()
....
TextBox4.Text = 
bit.BytesToString(buffer(), 4, count)
response.Close
End Sub
Can you, please, advise how to use the asynchronous calls, esp. with respect to cookie? I read the response into array rather than
Code:
TextBox4.Text = Response.GetString
Reply With Quote