Package the returned result of URL as the file flow.




The function packages the returned result of URL string of HTTP service into a file flow and returns it, which can only be retrieved with segmentation forbidden.



HTTP service in the URL string format.

Parameter port is the port number configured in Http Server. The dfx path is the one relative to the main directory configured in Tool -> Options -> Environment.

Two scenarios about the syntax of writing a URL for performing an HTTP service:

I. esProc style

  Syntax of writing a URL when using esProc’s HTTP service:

  http:// IP:port /dfx1.dfx()

   http:// IP:port /dfx1.dfx(arg1,arg2,...)

http://IP: port/dfx1.dfx(...)dfx2.dfx

http://[IP6]:port /dfx1.dfx()

1. There’s only one dfx file. If the dfx file has parameters, write them in order in the parentheses after the file; use comma to separate the multiple parameters. If the dfx file hasn’t parameters, the parentheses are empty; in this case the format of the file’s return value is what a user expects.

2. There are two dfx files. When the return value format a user wants is different from the format of the return value in dfx1 file, dfx2 file is used to change the format of the return value in dfx1 into a desired one. The syntax for dfx1 is the same as the that for the dfx file in the first scenario, but here the file supports only the single result set. dfx2 file is a program with only one parameter, which is the return value of dfx1 file.

  dfx2 file converts the format of the return value in dfx1 file into a desired one and return it as a result. For example, in the table sequence returned by dfx1 file, fields are by default separated by “|”; you can change dfx1’s return value in dfx2 to use the blank space as the separator.

If the second result set, which must contain strings, is returned, it is treated as the header.

3.  For IPv6, bracket the IP address with [].

II. Regular style

   Syntax of writing a URL:

http://ip:port/splfile?argi=vi&... , where splfile does not contain the extension because parameters after the quotation mark cannot be read if it does; the program will search for the file according to extension in the order of .splx, .spl and .dfx.

Ⅲ. result style

When the spl script file is located in a subdirectory under the main directory, you can use result type to call it.

Syntax of writing a URL:

http://IP:port /Path/splfile  Call a spl script file without parameters

http://IP:port /Path/splfile/argvalue1/argvalue2,... Call a spl script file containing parameters

Path represents the splfile path relative to the main directory;

splfile is the name of spl script file, whose extension will be omitted at the call and searched in the order of .splx, .spl and .dfx;

argvalue1/argvalue2],... is the value of parameter splfile; multiple parameters are separated by “/”.

Note: To access database data from splfile, configure the value of autoConnect property as true in raqsoftconfig.xml’s DB node; you can’t connect to the database if skipping this configuration.


Character set, which supports JVM's built-in character set, and which by default is the default value of virtual machine.






A parameter submitted using the method specified in parameter method with a syntax like p1=v1&p2=v2…. can be omitted.

The method used to pass parameter param’s value; its value is GET or POST (default is POST)

The header property can have multiple items, like headerName1:value1,headerName2:value2,... (the format is "property":"value",…); or can be omitted. The execution of .property() function over a returned file object will return the header property.

Return value:

File flow






=httpfile("http:// localhost:9090/p1.dfx()":"GBK").import@t()

Here’s the p1.dfx file:

Load p1.dfx file from the http server, with the charset as GBK.



Here’s the p2.dfx file where StuId is the parameter.

3 is the value of parameter in p2.dfx file.



Here’s the p3.dfx file where StuId and Class are the parameters.

The two parameters are separated by a comma.



Here’s http2.dfx :


The returned result:




Here’s the http3.dfx:

The returned result:


By default the execution of http2.dfx file returns a sequence of STATE values. To return comma-separated strings, we process the result of http2.dfx using another dfx file http3.dfx.



testServlet returns a string of employee data in the JSON format.



Use POST method to pass parameter.



"{\"nodeIds\":[\"ns=102;s=AI_002_0600.PV\"], \"startTime\":\"2018/6/28 13:10:00\",

 \"endTime\":\"2018/6/28 13:11:0\", \"returnBounds\":\"false\", \"maxSizePerNode\":\"10\"}";


Pass parameter using JSON method at the server side; write parameter param in the form of a JSON string, and specify header property as Content-Type, which is separated from the parameter before by a semicolon.



Here’s gypb.dfx:

Set a cellset parameter:

result style is used. “/sr/pm” shows a position relative to the main directory; “gypb” points to the dfx fle gypb.dfx, and “3/15” means that parameter id’s value is 3 and parameter parent’s value is 15.



If the file is under the main directory, the port number can be directly followed by /splfile instead of the path. Here the URL means that dc.dfx is saved under the main directory and the parameter value is 22.



Load emp.dfx file through http service via IPv6 connectivity using GBK charset.


=httpfile(" ").import@t()

Below is content of file emp.Splx:

Below are cellset parameters:

Use regular style for the URL.



Upload parameters and files to an URL using the HTTP protocol.




The function uploads parameter ai and file parameter fi to an URL through HTTP protocol and returns character set cs or null or failure information when the upload fails.. Parameter ai can be absent but there must be at least one file parameter uploaded. Multiple parameters and file parameters can be uploaded as needed.



HTTP service’s URL string format


The charset of returned content, which is UTF-8 by default




Parameter values that will be parsed as a string


File parameters


The file path or BLOB

Return value:

The content of certain character set










INCLUDEPICTURE "H:\\mk:@MSITStore:D:\\0903esproc\\esProc\\documents\\zh\\函数参考.chm::\\topics\\函数参考.files\\image1224.png" \* MERGEFORMAT \d.

Read the file as BLOB data.



Parameters and the files have been uploaded successfully and the content of GBK charset is returned through the URL.



 A file has been uploaded successfully and the content of UTF-8 charset is returned through the URL.



Null is returned since the file upload fails.