GXHTTP class¶
- class GXHTTP(handle=0)[source]¶
GXHTTP class.
Connect to an Internet Server using
GXHTTP
.Note:
References:
Note that path and search must conform be xalpha string (ref 2.). Special characters can be specified with a %xx, where xx is the hex ASCII number. For example, a search string “This one” should be specified as “This%20one”
- classmethod create(url, user_name, password, purpose)[source]¶
This method creates a connection to an
GXHTTP
server- Parameters:
url (str) – URL of the server
user_name (str) – User name, “” for none
password (str) – Password, “” for none
purpose (str) – Purpose of communication (for user verification)
- Returns:
GXHTTP
Object- Return type:
New in version 5.0.
License: Geosoft Open License
Note: An OM user has the ability to control access and verification of access to servers over the Internet. A GX Developer has no way to change the users choice of access. This is to prevent the creation of GX’s that may be dangerous or may be used to collect information without the knowledgede of the user.
If the specified URL is restricted from access by the user, the create function will fail.
If the specified URL has not been accessed by this user before, or if the user has this site on “Verify”, the user will be presented with a dialog requiring verification before communication can begin. The user may choose to change the server site to a full “Trust” relationship, in which case the verification message will not reappear unless the site is explicitly changed back to verify or is restricted.
If you intend your GX to communicate with a server without verification, you must instruct your user to change their trust relationship with your server to “Trusted”. Your user will have the opportunity to do so the first time a script is run.
- download(file, bf, dynamic)[source]¶
Download file from the internet to a
GXBF
.- Parameters:
New in version 5.0.
License: Geosoft Open License
Note: The file will be written starting at the current location in the
GXBF
- get(cl, method, bf, ret_bf)[source]¶
Get data from a server.
- Parameters:
New in version 5.0.
License: Geosoft Open License
Note: Full contents of the
GXBF
are sent in anGXHTTP
GET message.GXBF
pointer is returned to location before the call.request URL will be: http://server/path?search
- is_null()[source]¶
Check if this is a null (undefined) instance
- Returns:
True if this is a null (undefined) instance, False otherwise.
- Return type:
bool
- post(cl, method, bf)[source]¶
Post data to the server.
- Parameters:
cl (str) – Http path (file or an ISAPI DLL)
method (str) – Http search string, no spaces
bf (GXBF) – Data to post
New in version 5.0.
License: Geosoft Open License
Note: Full contents of the
GXBF
are sent as anGXHTTP
POST message.request URL will be: http://server/path?search
- set_proxy_credentials(username, password)[source]¶
Assigns the proxy username and password so that user is not prompted when the first download fails
- Parameters:
username (str) – Username
password (str) – Password
New in version 7.2.
License: Geosoft Open License
- silent_download(file, bf, dynamic)[source]¶
Download file from the internet to a
GXBF
with no prompt for proxy authentication.- Parameters:
New in version 8.2.
License: Geosoft Open License
Note: The file will be written starting at the current location in the
GXBF
. No prompt for proxy authentication