GXHTTP class

class geosoft.gx.GXHTTP
Connect to an Internet Server using HTTP.

Note:

References:

1. http://www.w3.org/Protocols/HTTP/HTTP2.html

2. http://www.w3.org/Addressing/URL/5_BNF.html

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"
static create((GXContext)ctx, (str)arg1, (str)arg2, (str)arg3, (str)arg4) → GXHTTP:
This method creates a connection to an HTTP server
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – URL of the server
  • arg2 (str) – user name, “” for none
  • arg3 (str) – password, “” for none
  • arg4 (str) – Purpose of communication (for user verification)
Returns:

HTTP Object

Return type:

geosoft.gx.GXHTTP

New in version 5.0.0.

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((str)arg1, (GXBF)arg2, (int)arg3) → None:
Download file from the internet to a BF.
Parameters:
  • arg1 (str) – File Name on the HTTP site
  • arg2 (geosoft.gx.GXBF) – BF in which to place the file
  • arg3 (int) – Dynamic content (0 - no, 1 - yes)
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

The file will be written starting at the current location
in the BF
get((str)arg1, (str)arg2, (GXBF)arg3, (GXBF)arg4) → None:
Get data from a server.
Parameters:
  • arg1 (str) – http path (file or an ISAPI DLL), no spaces
  • arg2 (str) – http search string, no spaces
  • arg3 (geosoft.gx.GXBF) – data to send
  • arg4 (geosoft.gx.GXBF) – data returned
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Full contents of the BF are sent in an HTTP GET message.
BF pointer is returned to location before the call.

request URL will be:
http://server/path?search
is_null() → bool

Check if the instance of geosoft.gx.GXHTTP is null (undefined)

Returns:True if this is a null instance of geosoft.gx.GXHTTP, False otherwise.
Return type:bool`
static null() → GXHTTP

A null (undefined) instance of geosoft.gx.GXHTTP

Returns:A null geosoft.gx.GXHTTP
Return type:geosoft.gx.GXHTTP
post((str)arg1, (str)arg2, (GXBF)arg3) → None:
Post data to the server.
Parameters:
  • arg1 (str) – http path (file or an ISAPI DLL)
  • arg2 (str) – http search string, no spaces
  • arg3 (geosoft.gx.GXBF) – data to post
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Full contents of the BF are sent as an HTTP POST message.

request URL will be:
http://server/path?search
set_proxy_credentials((str)arg1, (str)arg2) → None:
Assigns the proxy username and password so that
user is not prompted when the first download fails
Parameters:
  • arg1 (str) – username
  • arg2 (str) – password
Returns:

Nothing

Return type:

None

New in version 7.2.0.

silent_download((str)arg1, (GXBF)arg2, (int)arg3) → None:
Download file from the internet to a BF with no prompt for proxy authentication.
Parameters:
  • arg1 (str) – File Name on the HTTP site
  • arg2 (geosoft.gx.GXBF) – BF in which to place the file
  • arg3 (int) – Dynamic content (0 - no, 1 - yes)
Returns:

Nothing

Return type:

None

New in version 8.2.0.

Note:

The file will be written starting at the current location
in the BF. No prompt for proxy authentication