URL Request to Run a PxPlus Program |
|
URL to Run Program: |
protocol://server[:socket]/program[;entry][?argument[&argument...]] |
Where:
protocol |
Applicable network protocol; e.g. http:// or ftp://. |
server |
Server name. Use an IP (Internet Protocol) address such as 127.0.0.1 or a DNS (domain name) such as www.pvxplus.com. |
socket |
Optional TCP socket or port number (an integer preceded by a colon). Valid range: 1 to 65535. Values below 2000 are normally reserved for standard Internet activities. By default, all requests from a client are sent to TCP socket 80 unless you override the port number in your URL statement. To do this in any HTTP-compliant browser, include a :colon and the port number right after the server name. Example: The first URL below would default to TCP socket 80. The second would connect with TCP socket 3000: |
program |
Name of the PxPlus program that the browser is asking the Web Server to RUN. Note that Your Web Application Must "Stand Alone" (see below). |
entry |
Optional line label where the PxPlus program starts.See Entry Points. If you omit this, PxPlus starts running your application at the first executable line of code in your program. |
argument(s) |
Optional argument(s). Mark the start of your argument list with a leading ? question mark and when you have more than one argument, use an & ampersand as the separator between arguments. |
The following points explain how the Web Server works when it receives a URL request to run a program:
Incoming requests are processed by the next available task handler. All requests are independent of each other and do not interrelate or share information with each other. Each Web application must stand alone in the here and now.
Note that task handlers will:
Task handlers will not automatically clear your GLOBAL variables, and the global variables are not shared between task handlers (so you must initialize your global variables in your applications).
You can use a Web concept called a "cookie" to share information from one request to another. See *web/cookie Utility.
You can use URLs (Uniform Resource Location requests) to pass arguments and information to your given applications. See the examples and explanations below.
Example:
The example shown here is a simple GET request to run a PxPlus program. (The POST method would relegate variables and data to the body of the request. See Client-Browser Requests for information on the differences between GET and POST requests.)
http://server/myapp/myprog;start_here?my_str_var=abc&my_B_var&next_var=123
The PxPlus Programming Language allows you to use line-label entrypoints (e.g. in CALL directives). You can also include entry points in Web Server URLs to redirect processing in your Web applications. In the previous example, a PxPlus Web Server task handler would run the PxPlus program myprog, starting execution at the program line labelled start_here: instead of at the first executable line of the program.
If you include variables as arguments in your URL, PxPlus treats them as real variables in PxPlus itself. The task handler parses the URL and creates any variables it finds in your argument list. It preloads them (either with any data sent along with them or with Boolean values) before it runs your program. You can use:
You can use your URL arguments to load values into your application to set conditions controlling processing.
In addition to your own variables, you can make use of the PxPlus Web Server's own variables in your programs. See the list of reserved PxPlus Web Server Variables.
Your URL can also include command line arguments. Note this and +that in the example below. PxPlus evaluates everything between the argument separators (?, &) as a unit. If a unit has no = equals sign but includes a + plus sign, the Web Server interprets the unit as command line arguments.
Example:
http://server/makewish;init?this+that&what=PxPlus+Web+Server&mine
The task handler would parse this URL and load the arguments as: