Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Internet service – PB Docs 2022 – PowerBuilder Library

Internet service – PB Docs 2022

Internet service

Note

Inet object is considered to be obsolete.
Obsolete features are still available to use, but are no
longer eligible for technical support and will no longer be enhanced.
You can replace it by using the WebBrowser control or the HTTPClient
object.

Use the Internet service to:

  • Display a Web page in the default browser (HyperLinkToURL
    function, which starts the default browser with the specified
    URL)

  • Access the HTML for a specified page (GetURL function, which
    performs an HTTP Get)

  • Send data to a CGI, ISAPI, or NSAPI program (PostURL function,
    which performs an HTTP Post)

Hyperlinking to a URL

You call the Internet service’s HyperLinkToURL function to start
the default browser with a specified URL.

To hyperlink to a URL:

  1. Declare an instance or global variable of type inet:

  2. Create the Internet service by calling the GetContextService
    function:

  3. Call the HyperLinkToURL function, passing the URL of the page
    to display when the browser starts:

Getting a URL

You call the Internet service’s GetURL function to perform an HTTP
Get, returning raw HTML for a specified URL. This function returns the
raw HTML using the InternetResult object.

To perform an HTTP Get:

  1. Declare an instance or global variable of type Inet. Also
    declare an instance or global variable using the descendant
    InternetResult object as the datatype (n_ir_msgbox in this
    example):

  2. Create the Internet service by calling the GetContextService
    function:

  3. Create an instance of the descendant InternetResult
    object:

  4. Call the GetURL function, passing the URL of the page to be
    returned and a reference to the instance of the descendant
    InternetResult object:

    When the GetURL function completes, it calls the InternetData
    function defined in the descendant InternetResult object, passing
    the HTML for the specified URL.

Posting to a URL

You call the Internet service’s PostURL function to perform an
HTTP Post, sending data to a CGI, ISAPI, or NSAPI program. This function
returns the raw HTML using the InternetResult object.

To perform an HTTP Post:

  1. Declare an instance or global variable of type Inet. Also
    declare an instance or global variable using the descendant
    InternetResult object as the datatype (n_ir_msgbox in this
    example):

  2. Create the Internet service by calling the GetContextService
    function:

  3. Create an instance of the descendant InternetResult
    object:

  4. Establish the arguments to the PostURL function:

  5. Call the PostURL function, passing the URL of the routine to
    be executed, the arguments, the header, an optional server port
    specification, and a reference to the instance of the descendant
    InternetResult object:

    When the PostURL function completes, it calls the InternetData
    function defined in the descendant InternetResult object, passing
    the HTML returned by the specified routine.

Using the InternetResult
object

The GetURL and PostURL functions both receive data in an
InternetResult object. This object acts as a buffer, receiving and
caching the asynchronous data as it is returned by means of the
Internet. When all data is received, the InternetResult object calls its
InternetData function, which you override to process the data as
appropriate.

Implement in descendants of InternetResult

You implement this feature by creating standard class user
objects of type InternetResult. In each of these descendant user
objects, define an InternetData function to process the passed HTML as
appropriate.

To implement a descendant InternetResult object:

  1. Create a standard class user object of type
    InternetResult.

  2. Declare a new user object function as follows:

    • Name

      InternetData

    • Access

      Public

    • Returns

      Integer

    • Argument name

      Data, passed by value

    • Argument datatype

      Blob

  3. Add code to the InternetData function that processes the
    returned HTML as appropriate. This example simply displays the HTML
    in a MessageBox:


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x