|
@@ -1,6 +1,9 @@
|
|
1
|
+import com.fasterxml.jackson.core.JsonProcessingException;
|
1
|
2
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
3
|
+import com.oracle.javafx.jmx.json.JSONException;
|
2
|
4
|
import jdk.nashorn.internal.ir.RuntimeNode;
|
3
|
5
|
import okhttp3.*;
|
|
6
|
+import sun.plugin2.message.Message;
|
4
|
7
|
|
5
|
8
|
import java.io.IOException;
|
6
|
9
|
|
|
@@ -25,7 +28,13 @@ public class YouAreEll {
|
25
|
28
|
}
|
26
|
29
|
|
27
|
30
|
|
28
|
|
-
|
|
31
|
+ public String postMessage(String fromid, String toid, String message) throws JsonProcessingException{
|
|
32
|
+ ObjectMapper mapper = new ObjectMapper();
|
|
33
|
+ Messages myMessage = new Messages(fromid, toid, message);
|
|
34
|
+ String payload = mapper.writeValueAsString(myMessage);
|
|
35
|
+ String url = "/ids/" + toid + "/messages";
|
|
36
|
+ return MakeURLCall(url, "POST", payload);
|
|
37
|
+ }
|
29
|
38
|
|
30
|
39
|
public String get_ids() {
|
31
|
40
|
return MakeURLCall("/ids", "GET", "");
|