I am trying to use HttpUtils.PostString method, instead of Get. Previous working code is:
Dim hc as HttpClient
Dim req as HttpRequest
Dim r as string
r="http://mysite/Folder/Application.aspx?CommandString"
req.InitializeGet(r)
hc.Execute(req, 1)
(and get the aswer in StreamFinish)
To change the previous method, I started from the simple code reported in the HttpUtils first issue post, substituting the following:
1) In Sub Globals we have now b4a="http://mysite/Folder/Application.aspx"
2) Instead of HttpUtils.DownLoad of the basic code, I use:
HttpUtils.PostString("Job1",b4a,CommandString)
(CommandString is, for example : "O=1&N=xxx&P=yyy")
So , in the example modified code, we have:
Sub Globals
Dim b4a As String
b4a = "http://mysite/Folder/Application.aspx"
End Sub
Sub Activity_Create (FirstTime As Boolean)
HttpUtils.CallbackActivity = "Main" 'Current activity name.
HttpUtils.CallbackJobDoneSub = "JobDone"
'HttpUtils.Download("Job1", b4a)
HttpUtils.PostString("Job1",b4a,"O=1&N=pipp&P=www")
End Sub
Sub JobDone (Job As String)
Dim s As String
If HttpUtils.IsSuccess(b4a) Then
s = HttpUtils.GetString(b4a)
End If
End Sub
In JobDone function HttpUtils.IsSuccess(b4a) is never true.
Can anybody tell me what I am missing?
Thanks in advance..
Dim hc as HttpClient
Dim req as HttpRequest
Dim r as string
r="http://mysite/Folder/Application.aspx?CommandString"
req.InitializeGet(r)
hc.Execute(req, 1)
(and get the aswer in StreamFinish)
To change the previous method, I started from the simple code reported in the HttpUtils first issue post, substituting the following:
1) In Sub Globals we have now b4a="http://mysite/Folder/Application.aspx"
2) Instead of HttpUtils.DownLoad of the basic code, I use:
HttpUtils.PostString("Job1",b4a,CommandString)
(CommandString is, for example : "O=1&N=xxx&P=yyy")
So , in the example modified code, we have:
Sub Globals
Dim b4a As String
b4a = "http://mysite/Folder/Application.aspx"
End Sub
Sub Activity_Create (FirstTime As Boolean)
HttpUtils.CallbackActivity = "Main" 'Current activity name.
HttpUtils.CallbackJobDoneSub = "JobDone"
'HttpUtils.Download("Job1", b4a)
HttpUtils.PostString("Job1",b4a,"O=1&N=pipp&P=www")
End Sub
Sub JobDone (Job As String)
Dim s As String
If HttpUtils.IsSuccess(b4a) Then
s = HttpUtils.GetString(b4a)
End If
End Sub
In JobDone function HttpUtils.IsSuccess(b4a) is never true.
Can anybody tell me what I am missing?
Thanks in advance..