matrixtool client json - Perform a direct JSON request
$ matrixtool client -u @me:example.com json /_matrix/client/r0/publicRooms
This command performs a direct low-level HTTP request to a Matrix homeserver. The server name part of the URL is automatically inferred from the given user ID; the PATH commandline argument only requires the path and optional query parameters. If an access token is known for the user (see matrixtool client login) then it is automatically added to the query parameters as well.
matrixtool client login
An optional second argument, DATA, may be provided. If so, this should contain a JSON encoding of data to supply with the request, turning it into a PUT request. If no data is supplied, then a GET request is performed instead.
PUT
GET
The resulting JSON data from the homeserver is parsed and re-printed in a more human-readable form to standard output. Linefeeds and indentation whitespace are used to increase readability.
--method
-m
Use a different HTTP method. If not specified, GET or PUT will be performed, depending on whether the DATA argument was supplied.
For example, directly querying your user profile data:
$ matrixtool client -u @me:example.com json \ /_matrix/client/r0/profile/@me:example.com { "avatar_url": "mxc://example.com/aBcDeFgHiJ...", "displayname": "Mr Example", }
By supplying a second parameter containing JSON-encoded data, we can perform a PUT request to update the displayname:
$ matrixtool client -u @me:example.com json \ /_matrix/client/r0/profile/@me:example.com/displayname \ '{"displayname":"Mr. Example"}' {}
Paul Evans <leonerd@leonerd.org.uk>
To install App::MatrixTool, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::MatrixTool
CPAN shell
perl -MCPAN -e shell install App::MatrixTool
For more information on module installation, please visit the detailed CPAN module installation guide.