1

我目前正在为 android 使用 b4a

这是出现的错误

enter code here
 ',' expected.`enter code here`


enter code here
Dim j As HttpJob
            j.Initialize("", Me)
            j.PostString($"http://kccug.com/KabojjaApp/RecieveSMS.ashx?customerId=${act}&s=${edtMessage.Text}&d=${getdate(DateTime.Now)}&id=${NewID}&ph=${phone}&f=${sx}"$ )
            Wait For (j) JobDone(j As HttpJob)
            If j.Success Then
                Log(j.GetString)
            End If

enter code here
4

1 回答 1

0

You are using j.PostString which sends a post request. However, you are not using it correctly. j.PostString requires a second parameter: the post data. B4A expects you to put in a comma and the second paramter after the url, but you are only giving 1 parameter (the url) to the function. However, looking at your URL, it seems like your backend is handling stuff through GET requests only anyway, not POST. So really, what you should be using is j.Download. Try this code:

Dim j As HttpJob
j.Initialize("", Me)
j.Download($"http://kccug.com/KabojjaApp/RecieveSMS.ashx?customerId=${act}&s=${edtMessage.Text}&d=${getdate(DateTime.Now)}&id=${NewID}&ph=${phone}&f=${sx}"$)
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
    Log(j.GetString)
End If

It's exactly the same, but it uses Download instead of PostString.

于 2021-05-02T08:54:53.293 回答