Guest User

Untitled

a guest
Oct 9th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. public static void main(String[] args) throws Throwable {
  2. try {
  3. String username = "****";
  4. String password = "****";
  5. String cred = Base64.encodeBytes((username + ":" + password).getBytes());
  6.  
  7. Map<String, String> headers = new HashMap<>(1);
  8. headers.put("Authorization", "Basic " + cred);
  9.  
  10. JsonRpcHttpClient client = new JsonRpcHttpClient(new URL("https://dms1.ok.by/api/v1/json­rpc"));
  11. String elem = client.invoke("myMethod", new Object [] {"param"}, domain, String.class);
  12.  
  13. }
  14. catch(Throwable throwable) {
  15. throwable.printStackTrace();
  16. }
  17. }
Add Comment
Please, Sign In to add comment