When you use JSON to call an API - not a REST API, but something like JSON-RPC - you will usually want to encode one of several possible messages.
Your request body looks like this:
{
"type": "MessageWithA",
| #!/bin/bash | |
| # Downloading packages | |
| wget http://ftp.it.debian.org/debian/pool/main/g/gconf/gconf2_3.2.6-8_amd64.deb | |
| wget http://ftp.it.debian.org/debian/pool/main/g/gconf/libgconf-2-4_3.2.6-8_amd64.deb | |
| wget http://ftp.it.debian.org/debian/pool/main/g/gconf/gconf2-common_3.2.6-8_all.deb | |
| wget http://ftp.it.debian.org/debian/pool/main/g/gconf/gconf-service_3.2.6-8_amd64.deb | |
| wget http://ftp.it.debian.org/debian/pool/main/o/openldap/libldap-2.5-0_2.5.13%2bdfsg-5_amd64.deb | |
| wget https://security.ubuntu.com/ubuntu/pool/universe/liba/libappindicator/libappindicator1_12.10.1+20.10.20200706.1-0ubuntu1_amd64.deb | |
| wget http://mirrors.kernel.org/ubuntu/pool/universe/libd/libdbusmenu/libdbusmenu-gtk4_16.04.1+18.10.20180917-0ubuntu8_amd64.deb |
| #!/usr/bin/env python3 | |
| # vim: autoindent tabstop=4 shiftwidth=4 expandtab softtabstop=4 filetype=python | |
| # This file is part of Supermicro IPMI certificate updater. | |
| # Supermicro IPMI certificate updater is free software: you can | |
| # redistribute it and/or modify it under the terms of the GNU General Public | |
| # License as published by the Free Software Foundation, version 2. | |
| # | |
| # This program is distributed in the hope that it will be useful, but WITHOUT |
| ### | |
| # Nginx vhost file to hide Proxmox pveproxy | |
| # For 3.4+, 5.x version. | |
| # | |
| # Do not forget to create file | |
| # /etc/default/pveproxy: | |
| # ALLOW_FROM="127.0.0.1" | |
| # DENY_FROM="all" | |
| # POLICY="allow" | |
| # |
| #!/usr/bin/env python | |
| # coding=utf-8 | |
| from __future__ import print_function | |
| from __future__ import division | |
| import os | |
| import re | |
| import sys | |
| from collections import namedtuple |
| #pragma once | |
| #include <boost/optional.hpp> | |
| /** | |
| * Wraps any value with a context of Left for the Either class. | |
| * | |
| * By convention, Left represents some sort of less-desired condition. | |
| */ |
| // Compile with: | |
| // clang++ -std=c++11 -shared -l boost_python3 -I /usr/include/python3.2mu -fPIC -o bptuple.so tuple-test.cpp | |
| #include <tuple> | |
| #include <string> | |
| #include <boost/python.hpp> | |
| namespace py = boost::python; | |
| using std::string; |
| #include <boost/any.hpp> | |
| #include <boost/spirit/include/qi.hpp> | |
| #include <boost/fusion/include/std_pair.hpp> | |
| #include <vector> | |
| #include <map> | |
| #include <iostream> | |
| namespace json { |