[Gambas-user] HTTP Form

T Lee Davidson t.lee.davidson at gmail.com
Mon May 16 16:06:53 CEST 2022

On 5/16/22 04:57, Gianluigi wrote:
> Dear Lee,
> in the meantime, I renew my thanks and apologize for the drudgery to
> which I subject you (one of the heaviest labors is to explain
> something to a hard head like mine)

It's not drudgery, Gianluigi. I enjoy it.

> I think I understand the general concept, what I just can't get my
> head around is:
> Does HTTPForm serve to open an html page or not?

The answer depends on what you mean by, "open". If you mean, does it retrieve a web page and render it for display like a web 
browser does, then the answer is No.

> Because if it is for opening a page then I don't understand how you
> can do it, here the examples keep returning html code and they don't
> open anything '(

Receiving the HTML code is precisely what it is supposed to do. A web server sends HTML text whether the client is a browser, 
HttpClient, HttpForm, or even Telnet. A browser interprets the HTML code and renders it for display to the user. The other 
clients I mentioned do not. They just receive the HTML code. What the user or programmer does with it after that is up to 
him/her. In my client example, I place the HTML code in the TextArea.

>>> P.S. I was not able to use HttpForm to login in to the BugTracker. Curl appears to choke on submitting a form through a 302
>>> redirection due to: "necessary data rewind not possible".

I am not getting this error today. Perhaps I was having difficulty yesterday due to whatever was causing the Error 520, that 
BruceS and I experienced, on the Wiki.

> If I use .URL = "http://gambaswiki.org" as the address, I get:

Why would you use that URL? It is not a URL designated as a form data receiver/processor (in a form's "action" attribute).

Remember, HttpForm is only for submitting (POSTing) form data and receiving the HTML response. It inherits HttpClient and 
behaves almost identically except for its form submitting capabilities.

> If instead I use .URL = "http://gambaswiki.org/bugtracker" as the
> address, I get:
> "http://www.w3.org/TR/html4/strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml"
> xmlns:v="urn:schemas-microsoft-com:vml">

Now that *is* a form data processor URL. And the HTML code is similar to what I get today. But, it appears that a successful 
login was not accomplished. Now that the Curl error (-1065) is apparently no longer occurring, I will need to investigate this 
further. I'm glad you mentioned this; otherwise I would not have known.


More information about the User mailing list