You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: i18n/en/docusaurus-plugin-content-docs-zennobrowser/current/zb-public-API/getting-started-with-the-zennobrowser-api.mdx
+49Lines changed: 49 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,3 +47,52 @@ The API Token is required to execute all requests. It can obtained as follows:
47
47
1. After deleting the token, it will continue functioning within 1.5-2 hours;
48
48
2. After token has expired, it will cease to function;
49
49
3. If you have lost a previously created token, you can create a new one.
50
+
51
+
## **Parameter Encoding (URL Encoding)**
52
+
53
+
### **Important: Passing special characters in parameter values**
54
+
55
+
If you construct HTTP requests manually (using `HttpClient`, `fetch`, `curl`, etc.), you **must URL-encode parameter values**.
56
+
57
+
This is especially important for parameters like `screen=HD+`.
58
+
If the `+` character is not encoded, the server will interpret it as a **space**, which will result in an error.
59
+
60
+
**Example for `screen=HD+`**
61
+
62
+
***Incorrect:**`.../create?screen=HD+`
63
+
***Correct:**`.../create?screen=HD%2B`
64
+
65
+
### Commonly Used Characters
66
+
67
+
For the API to work correctly, the following characters **must be encoded when they are part of parameter values**.
68
+
69
+
Encode these characters **only if they are part of the actual data (values)**, not as URL syntax.
70
+
71
+
| Character | Description | Encoded |
72
+
| ----- | ----- | ----- |
73
+
|`+`| Plus sign (e.g. `HD+`) |`%2B`|
74
+
| (space) | Space |`%20`|
75
+
|`&`| Ampersand (parameter separator) |`%26`|
76
+
|`=`| Equals sign |`%3D`|
77
+
|`?`| Question mark |`%3F`|
78
+
|`/`| Slash |`%2F`|
79
+
|`:`| Colon |`%3A`|
80
+
81
+
### Implementation Examples
82
+
83
+
**C# (HttpClient)**
84
+
85
+
Instead of manually concatenating strings, use `Uri.EscapeDataString()` for parameter values that may contain special characters.
0 commit comments