请帮助您使用JAVA POST API调用flowgear工作流程。 我的flowgear终点是6.somesubdomain.mydomain(这个终点是有效的吗?)。我用这段代码来调用flowgear工作流但是它不起作用我的终点不是调用(请检查我的终点是否有效)。
URL myURL = new URL("https://6.somesubdomain.mydomain.flowgear.io/test/");
HttpURLConnection con = (HttpURLConnection)myURL.openConnection();
String userCredentials = "email:password";
String basicAuth = "Basic " + new String(new Base64().encode(userCredentials.getBytes()));
con.setRequestProperty ("Authorization", basicAuth);
con.setDoOutput(true);
con.setDoInput(true);
con.setUseCaches(false);
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestMethod("POST");
con.connect();
OutputStream os = httpCon.getOutputStream();
OutputStreamWriter osw = new OutputStreamWriter(os, "UTF-8");
osw.write(somejsondata.toString());
osw.flush();
osw.close();
请给我回复。 感谢。