mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-21 20:25:51 +00:00
For better URLs, the content folder has been renamed 'docs' and all other files have been moved up a level. Also, non-docs images have been moved to the static folder at the top level where they belong. Many relative paths had to be fixed to make this work.
50 lines
1.1 KiB
Markdown
50 lines
1.1 KiB
Markdown
---
|
|
html: json.html
|
|
parent: utility-methods.html
|
|
seo:
|
|
description: Pass JSON through the commandline.
|
|
labels:
|
|
- Core Server
|
|
---
|
|
# json
|
|
|
|
The `json` method is a proxy to running other commands, and accepts the parameters for the command as a JSON value. It is *exclusive to the Commandline client*, and intended for cases where the commandline syntax for specifying parameters is inadequate or undesirable.
|
|
|
|
## Request Format
|
|
An example of the request format:
|
|
|
|
{% tabs %}
|
|
|
|
{% tab label="Commandline" %}
|
|
```sh
|
|
# Syntax: json method json_stanza
|
|
rippled -q json ledger_closed '{}'
|
|
```
|
|
{% /tab %}
|
|
|
|
{% /tabs %}
|
|
|
|
## Response Format
|
|
|
|
An example of a successful response:
|
|
|
|
{% tabs %}
|
|
|
|
{% tab label="WebSocket" %}
|
|
```json
|
|
{
|
|
"result" : {
|
|
"ledger_hash" : "8047C3ECF1FA66326C1E57694F6814A1C32867C04D3D68A851367EE2F89BBEF3",
|
|
"ledger_index" : 390308,
|
|
"status" : "success"
|
|
}
|
|
}
|
|
```
|
|
{% /tab %}
|
|
|
|
{% /tabs %}
|
|
|
|
The response follows the [standard format][], with whichever fields are appropriate to the type of command made.
|
|
|
|
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|