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

PostURL – PB Docs 2021 – PowerBuilder Library

PostURL – PB Docs 2021

PostURL

PowerScript function

Description

Performs an HTTP Post, allowing a PowerBuilder application to send a
request through CGI, NSAPI, or ISAPI.

Applies to

Inet objects (Obsolete)

Syntax

Argument

Description

servicereference

Reference to the Internet service instance.

urlname

String specifying the URL to post.

urldata

Blob specifying arguments to the URL specified by
urlname.

headers

String specifying HTML headers. In Netscape, a newline
(~n) is required after each HTTP header and a final newline
after all headers.

serverport

(optional)

Specifies the server port number for the request. The
default value for this argument is 0, which means that the port
number is determined by the system (port 80 for HTTP
requests).

data

InternetResult instance into which the function returns
HTML.

Return value

Integer. Returns values as follows:

1 — Success

-1 — General error

-2 — Invalid URL

-4 — Cannot connect to the Internet

-5 — Unsupported secure (HTTPS) connection attempted

-6 — Internet request failed

Usage

Call this function to invoke a CGI, NSAPI, or ISAPI function.

Data references a standard class user object that descends from
InternetResult and that has an overridden InternetData function. This
overridden function then performs the required processing with the
returned HTML. Because the Internet returns data asynchronously, data must
reference a variable that remains in scope after the function executes
(such as a window-level instance variable).

To simulate a form submission, you need to send a header that
indicates the proper Content-Type. For forms, the proper Content-Type
header is:

For more information on the InternetResult standard class user
object and the InternetData function, use the PowerBuilder Browser.

Timeout value for sending a request

The PostURL function relies on wininet.dll to post a request and
returns -1 when the posting time exceeds the DLL timeout value. When you
install Internet Explorer 7 or later, the default timeout value for this
DLL is 30 seconds. Although it is possible to change the timeout value
by configuring a ReceiveTimeOut registry key under HKEY_CURRENT_USER
SOFTWAREMicrosoftWindowsCurrentVersionInternet Settings, this is not
recommended, since it can also affect the behavior of the Internet
Explorer browser.

Examples

This example calls the PostURL function using server port 8080.
Iinet is an instance variable of type inet:

This example shows the use of a header with the correct content-type
for a form:

See also

GetURL

HyperLinkToURL

InternetData


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