Sub Globals
End Sub
Sub App_Start
Form1.Show
End Sub
Sub Button1_Click
request.New1("http://www.b4x.com/print.php")
request.Method = "POST"
Request.ContentType = "application/x-www-form-urlencoded"
stream.New1(Request.GetStream,True)
name = "First=Erel&Last=Uziel"
stream.WriteBytes(stream.StringToBytes(name))
response.New1
request.GetAsyncResponse
End Sub
Sub request_Response
If request.ResponseCode = 200 Then
response.Value = request.AsyncResponse
response.GetAsyncString
Else
Msgbox(request.ErrorMessage)
End If
End Sub
Sub response_Stream
TextBox1.Text = response.AsyncString
End Sub
request.New1("[URL="http://www.b4x.com/forum/print.php"]http://site.com/page.php[/URL]")
request.Method = "POST"
Request.ContentType = "application/x-www-form-urlencoded"
stream.New1(Request.GetStream,True)
name = "[URL="http://site.com/page.php?lat=56.565&lng=58.424"]lat=56.565&lng=58.424[/URL] "
stream.WriteBytes(stream.StringToBytes(name))
response.New1
request.GetAsyncResponse
$data=file_get_contents('data.xml');
$data=str_replace("</markers>", "", $data);
$fd=fopen('data.xml', "w+");
fwrite($fd, $data);
fwrite($fd, '<marker lat="' . $_GET['lat'] . '" lng="' . $_GET['lng'] . '"/>');
fwrite($fd, "\n");
fwrite($fd, '</markers>');
fclose($fd);
<markers>
<marker lat="58.0057450" lng="56.2401117"/>
<marker lat="58.0064167" lng="56.2426733"/>
<marker lat=[B]""[/B] lng=[B]""[/B]/>
</markers>
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(1024) As 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
TextBox4.Text = Response.GetString
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))
[COLOR="Red"]request.GetAsyncResponse[/COLOR]
'reading cookie
regex.New1("PHPSESSID=.[a-zA-Z0-9]+")
match.New1
match.Value = regex.Match(response.Headers)
Session_ID = match.String
'operations with buffer() [COLOR="Blue"]'Here I want to use the buffer from response_Stream[/COLOR]
....
TextBox4.Text = bit.BytesToString(buffer(), 4, count)
response.Close
End Sub
Sub request_Response
response.Value = [COLOR="Red"]request.GetAsyncResponse[/COLOR]
[COLOR="Red"]response.GetAsyncStream[/COLOR]
End Sub
Sub response_Stream [COLOR="Blue"]'Here I want to read the response and put it to array. And then I want to use it in Sub Button1_click[/COLOR]
'Get the response into array
bin.New1(response.GetStream, True)
bit.New1
Dim buffer(1024) As byte
count = bin.ReadBytes(buffer(),1024)
For i = 0 To ArrayLen(buffer())-1
retezec = retezec & " " & buffer(i)
Next
Msgbox(retezec)
End Sub
response.Value = request.GetAsyncResponse
...
request.GetAsyncResponse
End Sub
Sub request_Response
response.Value = request.GetAsyncResponse
regex.New1("PHPSESSID=.[a-zA-Z0-9]+")
match.New1
match.Value = regex.Match(response.Headers)
Session_ID = match.String
...
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?