Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) throws Throwable {
- try {
- String username = "****";
- String password = "****";
- String cred = Base64.encodeBytes((username + ":" + password).getBytes());
- Map<String, String> headers = new HashMap<>(1);
- headers.put("Authorization", "Basic " + cred);
- JsonRpcHttpClient client = new JsonRpcHttpClient(new URL("https://dms1.ok.by/api/v1/jsonrpc"));
- String elem = client.invoke("myMethod", new Object [] {"param"}, domain, String.class);
- }
- catch(Throwable throwable) {
- throwable.printStackTrace();
- }
- }
Add Comment
Please, Sign In to add comment