diff --git a/Invoke-Method.md b/Invoke-Method.md new file mode 100644 index 0000000..3784fc2 --- /dev/null +++ b/Invoke-Method.md @@ -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 \ No newline at end of file