Created Invoke Method (markdown)

Namhyeon Go 2024-06-20 13:18:38 +09:00
parent 307fbf7df2
commit 8bd1dadbfa

33
Invoke-Method.md Normal file

@ -0,0 +1,33 @@
# Invoke Method
The Invoke Method feature has been supported since Caterpillar Proxy version 0.1.5.17. This feature allows you to remotely call functions defined on the server.
First, create a request in JSON format as shown below. Save it as a file named phpversion.json.
```json
{
"jsonrpc": "2.0",
"method": "relay_invoke_method",
"params": {
"callback": "phpversion",
"args": []
},
"id": ""
}
```
Next, use curl to perform a test to call the server's function remotely.
```sh
curl -X POST --data "@phpversion.json" -H "Content-Type: application/json" -H "User-Agent: php-httpproxy/curl" http://YOUR_HOSTNAME/
```
You should see the phpversion output as shown below.
```json
{"jsonrpc":"2.0","result":{"status":200,"data":"8.2.18"},"id":""}
```
## Report abuse
* ActivityPub [@gnh1201@catswords.social](https://catswords.social/@gnh1201)
* abuse@catswords.net