help figure out why the json request doesn’t work. Or give an example of a work request
https://5.*.70.*:5555/api/{"jsonrpc": "2.0","id": "rpc_call_id","method": "Test","params": {"IntValue_u32": 0}}
{
"error": {
"code": 33,
"message": "Error code 33: Unsupported."
},
"jsonrpc": "2.0",
"id": "2019-10-16 10:23:24.403"
}
help json request not work.
-
- Posts: 1
- Joined: Mon Mar 06, 2023 7:11 pm
Re: help json request not work.
I got exactly the same problem... i want to make a call directly via url.. for /api/serverinfo it works.. for things that need input it does not work :(
-
- Posts: 289
- Joined: Wed Dec 28, 2022 9:10 pm
Re: help json request not work.
check the source codevpngemensch wrote: ↑Mon Mar 06, 2023 7:13 pmI got exactly the same problem... i want to make a call directly via url.. for /api/serverinfo it works.. for things that need input it does not work :(
https://github.com/shakibamoshiri/secli
-
- Posts: 1637
- Joined: Sun Feb 14, 2021 10:31 am
Re: help json request not work.
This one-liner works for me...
Code: Select all
Linux
-----
curl -i -k -H "X-VPNADMIN-PASSWORD: ***" --json '{ "jsonrpc": "2.0", "id": "rpc_call_id", "method": "Test", "params": { "IntValue_u32": 0 } }' https://localhost:5555/api/
Windows
-------
curl -i -k -H "X-VPNADMIN-PASSWORD: ***" --json "{ \"jsonrpc\": \"2.0\", \"id\": \"rpc_call_id\", \"method\": \"Test\", \"params\": { \"IntValue_u32\": 0 } }" https://localhost:5555/api/
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: X-VPNADMIN-HUBNAME,X-VPNADMIN-PASSWORD
Access-Control-Allow-Methods: OPTIONS,GET,POST
Cache-Control: no-cache
Connection: Keep-Alive
Content-Length: 187
Content-Type: application/json
Date: Tue, 07 Mar 2023 03:02:40 GMT
{
"result": {
"Int64Value_u64": 0,
"IntValue_u32": 0,
"StrValue_str": "0",
"UniStrValue_utf": ""
},
"jsonrpc": "2.0",
"id": "rpc_call_id"
}