[Gambas-user] Building a Web Service in Gambas

Claus Dietrich claus.dietrich at freenet.de
Tue Jun 27 19:09:44 CEST 2023


Am 27.06.23 um 13:51 schrieb T Lee Davidson:
> On 6/27/23 05:23, Claus Dietrich wrote:
>> Am 26.06.23 um 08:14 schrieb KKing:
>>> So it's a few years since I asked this question .... is it possible 
>>> to build a web service with Gambas?
>>> K.
>>>
>>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>
>> I developed a class called HTTPServer and a module, which I use for 
>> adding a web interface to Gambas applications. It can also be used 
>> for HTTP micro services and deliver XML or JSON files.
>>
>> Interested? If so, I could provided you with a sample project where 
>> the "HTTP micro server" hosts a complete web page developed by Hans.
>>
>> Best regards
>>
>> Claus
>
> I would be interested in that, Claus. It would be quite handy, IMO, if 
> we had a HTTP server component.

I fully agree. The class will certainly not yet satisfy quality 
requirements for the use as Gambas component. Its intended purpose was 
rather simple. It allowed me to fit my flatbed scanner app with a web 
interface and I can now control it remotely with the browser of my 
mobile phone. Later I found, that I could do more with it and stressed 
it up the hosting of a web page developed by Hans.

The project demonstrates that the class can host web pages with audio- 
and video media, stylesheets and JavaScripts. It is further prepared for 
the transfer of various mime types including XML and JSON. I also tested 
up- and downloads of files successfully.

The module has been provided as an interface between the actual 
application and the HTTPServer-class.

Because of its size of >13MB I put the project on the cloud for 
download: https://magentacloud.de/s/o7rPPeHgLJinf5y

Just run the app. A small Window will show up and simply click on "open 
web site" which will open the browser to show the web page. The use of 
cookies has not (yet) been implemented. Have a look into it and see 
whether you find something useful in it. Comments are welcome.

Regards

Claus







More information about the User mailing list