Appendix 1. Paths to files and directories, working with HTTP-servers

To access files and directories in Parser, one may use absolute or relative paths.

Absolute path is started with slash. In this case, the file is searched for from web-space root. If a relative path is used, the file will be searched for from directory where requested document is located.

Example of absolute path:

Example of relative path:
relative to directory

While a file is saved, needed directories are created automatically.

Note: the root of web-space, passed by web-server, can be cahnged: see "Root of web-space"

Note: Parser transforms paths to
file-spec (see "External and internal data").


…can work with external HTTP-servers, provided the name of document to be loaded starts with prefix
If required, domain name is automaticaly encodes into IDNA representation. [3.4.4]

While using these methods, one can also specify extra options to control download behavior. These options are hash, with such keys as:

correspondes $request:charset
Charset used in documents on remote server. This charset is used to transcode request string. This charset is used to transcode response body if HTTP response does not contains charset.

This option also allowed while loading local text files. [3.2.2]

If a text file which is loaded without charset option, contains BOM code it will be transcoded automatically from UTF-8 to $request:charset.
taken from HTTP response header
Force specify charset for response body. [3.4.4]
2 seconds
HTTP server's response timeout in seconds. If download operation is not finished within this period, exception will be thrown.
The name of HTTP-method should be specified in uppercase only.

It's possible to specify it in lowercase as well. [3.3.1]
Possible values are:
or multipart/form-data.
Last one with method POST should be used if you need to send files to external HTTP server. [3.3.1]


Request parameters. For GET-request they will be passed in?query_string. For requests with other method, parameters will be passed with
Content-type: application/x-www-form-urlencoded
Parameter value can be string, table with one column or file [3.3.1].

It is preferable to pass parameters by means of
$.forms, and not pass it in?parameters by hand.

It is allowed to pass parameters in both styles simultaneously
. [3.1.5]
Text body of the query. (do not use form or METHOD[GET] when you use body)


Hash with list of cookies to be passed to HTTP-server. [3.2.3]

Hash with additional HTTP-headers to be passed to HTTP-server

HTTP-header's value may be a date, string or hash with obligatory key value.
Date may be used as either field value or field's attribute value. In this case, it will be object to standard formatting.

Boolean: is response status not equal to 200 allowed? If Boolean is FALSE, and received status is not equal to 200, system exception http.status will be thrown.
Don't add charset info to HTTP-header content-type for outgoing POST request. [3.3.0]
Force server output to specified charset. [3.4.3]
These are request parameters to server,
which uses standard HTTP-authorization.

For ^file::load[…] one can also specify additional loading options. These options are hash with such keys as:

While loading data, offset is specified in number of bytes.
Load no more than specified number of bytes

Copyright © 1997–2021 Art. Lebedev Studio | Last updated: 23.04.2016