Last active
June 11, 2018 18:16
-
-
Save scripting/67fd46d35998a0beda354e638d563cbf to your computer and use it in GitHub Desktop.
Egregious hack to add date and base64 types to JSON for XML-RPC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"methodCall": { | |
"methodName": "examples.echoParams", | |
"params": [ | |
"#dateTime=2018-06-10T19:41:06.199Z", | |
"#base64=aGVsbG8gd29ybGQ=" | |
] | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"methodCall": { | |
"methodName": "examples.echoParams", | |
"params": [ | |
{ | |
"#type": "dateTime", | |
"#value": "2018-06-10T19:41:06.199Z" | |
}, | |
{ | |
"#type": "base64", | |
"#value": "aGVsbG8gd29ybGQ=" | |
} | |
] | |
} | |
} |
Another example based on a similar idea.
https://gist.github.com/scripting/67fd46d35998a0beda354e638d563cbf#file-rpccall2-json
Dave
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Richard, the consumers wouldn't have to look inside the value to get the type, because that would be handled by the toolkit, as it is in XML-RPC's XML serialization.
JSON doesn't have a way of representing dates and binary info, but JavaScript does.