You can just use the import statement. Web2py code is just Python code running
in a web environment. Just know that at every web request all model files are
executed, and after that the controller file that corresponds with the URL of
the request. The view file with the same name is used to produce the HTML to
return.
So you can put the code in the controller
>>> import http.client
>>> conn = http.client.HTTPSConnection("www.python.org")
>>> conn.request("GET", "/")
>>> r1 = conn.getresponse()
Note that the Requests library is easier to use.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.