B4J Question Cannot POST /

jinyistudio

Well-Known Member
Licensed User
Longtime User
Hi

I always get a message "Cannot POST /" when i running following code job1.PostString(link,"").
link --> http://192.168.1.110:8080
B4X:
Sub run
    Dim job1 As HttpJob 
    Try
        job1.Initialize("run",Me)     
        Dim link As String="http://"&Hostip&":"&Hostport
        job1.PostString(link,"") 
    Catch
        Log("Exception:"&LastException)
    End Try
End Sub
Attachied file 192.168.1.110.txt(html) is send from http://192.168.1.110:8080 when i PostString(,,,)
 

Attachments

  • 192.168.1.110.txt
    219 bytes · Views: 174

jinyistudio

Well-Known Member
Licensed User
Longtime User
"Cannot POST /" isn't a Exception message. It's a message show in B4j log windows when i run job1.Poststring(,,).
The link isn't a empty string. Hostip and hostport are my class property.

What's the exception message?
It seems that you post an empty string to the server, what contents do the server (192.168.1.110:8080) expects? Is there any server log available?
 
Upvote 0

jinyistudio

Well-Known Member
Licensed User
Longtime User
I found following code is OK !!

B4X:
Sub run
    Dim job1 As HttpJob   
    Try
        job1.Initialize("run",Me)       
        Dim link As String="http://" & Hostip & ":" & Hostport & "/run"
        job1.Download(link)       
    Catch
        Log("Exception:" & LastException)
    End Try
End Sub
 
Upvote 0
Top