The USolver document is a JSON file that can be easily created and used. Additionally, you can run it directly on https://usolver.com without requiring additional setup. To do this, generate your JSON file and submit it via an HTTP form to the endpoint: "https://usolver.com/create/preview.html#file/post." Below are examples of such forms:
The form's method can be either a POST or a GET. If it is a POST, the endpoint should end with "...#/file/post", and if it is a GET, it should end with "...#/file/get". The form requires only one field, which is "usolver-file". This field is a text input containing the entire document in plain JSON format.
There are two additional optional fields: "encoding" and "root". The "encoding" field can have a value of either "json" or "base64". If set to "json", the file should be plain JSON text. If set to "base64", the file should be a Base64-encoded JSON string.
The "root" parameter is optional and specifies a base folder for all attached images and scripts unless those scripts are inlined.
| Parameter | Req. | Description | Possible Values |
|---|---|---|---|
usolver-file |
Yes | Contains the entire document in plain JSON format. | Plain JSON text |
encoding |
No | Specifies the file encoding. | json, base64 |
root |
No | Specifies a base folder for all attached images and scripts unless inlined. | https://mydomain.com/folder |
If file is encoded with base64 and if it has multibyte characters (such as chineese in UTF-8 for example), it needs to be encoded with the following JS function
You can also load USolver files from a remote location. To do so, you need to open preview and pass url where to load file from. For example:
Open Samplewhere file path can be either absolute or relative to the current domain
You can pass base64 encoded USolver file in the URL:
Open Sample