
nettobac is a FreeBASIC extension to handle network connections. It is implemented in OOP (object orientated programming) as classes, designed to get included in users source code at module level. It provides features to handle network transfer similar to FB file access like
- OPEN and CLOSE network connections
- PUT (= send) or GET (= receive) data thereover
The package is hosted at GitHub and it contains
- the source code in folder *src/bas*
- the nettobac classes
- utility functions for http protocol
- two examples for client and server usage
- the configuration files to build the documentation in folder *doxy*
- the documentation context in .md files in folder *src/doc*
- CMake scripts to build several targets (ie. all, doc, doc_htm, doc_pdf)
Downloading a file over the web is as easy as
Code: Select all
#INCLUDE ONCE "nettobac.bas"
#INCLUDE ONCE "nettobac_http.bas"
VAR res = "" _
, msg = httpLoad(res, "www.freebasic.net/index.html")
IF msg THEN ?"error: " & *msg & " failed" : END 1
' here variable res contains the web page context
Find detailed informations in the online documentation at http://users.freebasic-portal.de/tjf/Pr ... /doc/html/
Have fun!