[Gambas-user] requests to gambas cgi scripts issues

PICCORO McKAY Lenz mckaygerhard at ...626...
Tue Aug 5 21:50:33 CEST 2014


i try to comunicate a desktop gambas app with a cgi web gabmas app, but
seems i do not know how to make the request from the desktop app.
i made that code:

=================
Dim sCad As String
POA = New HttpClient As "POA"

    sCad = "<html>"
    sCad = sCad & "<form action=\"http://localhost/test1.webpage\"
method=post enctype=\"application/x-www-form-urlencoded\" >"
    sCad = sCad & "<input type=\"text\" name=\"p1usuario\" value=\"name1\"
/>"
    sCad = sCad & "<input type=\"text\" name=\"p1clave\" value=\"123456\"
/>"
    sCad = sCad & "<input type=\"submit\" value=\"Submit\" />"
    sCad = sCad & "</form>"
    sCad = sCad & "</html>"
    POA.URL = "http://" & hostcentral &
"/serialservicio/SSpeticiones1.webpage"
    POA.Post("text/html", sCad)
=================

but do not work,

with a simpel HTML form works perfectly, if i doing in wrong way , please
telme how could i send data on request from a desktop gambas apllication to
a web gambas aplication (some thing like webservice, jeje)

the cgi script runs perfectly:

=================
#!/usr/bin/env gbw3
<%
USE "gb.vb"

Dim printout As String
Dim llamada As String
Dim p1usuario As String
Dim p1clave As String

    p1usuario = Request.post["p1usuario"]
    If (String.Comp(p1usuario, "") = 0) Then
            printout = "-1"
        Else
            p1clave = Request.post["p1clave"]
            printout = "exito: " & p1usuario & " " & p1clave
        Endif
    Endif
Endif
%>

<%= printout %>
=================

i tested and works with a html form:

===================
<html>
<form action="http://localhost/test1.webpage" method=post
enctype="application/x-www-form-urlencoded" >
<input type="text" name="p1usuario" value="as" />
<input type="text" name="p1clave" value="asd" />
<input type="submit" value="pepe">
</form>
</html>
===================


Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com



More information about the User mailing list