0

来自空间锚样本 (AnchorPoster.java) 现在它只将 anchorid 推送到 cosmos db。我如何将其他数据推送到新列?这是我当前的代码位于示例中的 AnchorPoster 中,但是 cp1 cp2、cp3 与 anchorid 结合使用。

@Override
protected String doInBackground(String... input) {
    return postAnchor(input[0],input[1],input[2],input[3]);
}

@Override
protected void onPostExecute(String result) {
    if (anchorPostedCallback != null) {
        anchorPostedCallback.accept(result);
    }
}

private String postAnchor(String anchor,String CP1, String CP2, String CP3) {
    String ret;
    try {
        URL url = new URL(baseAddress);
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("POST");
        connection.setDoOutput(true);
        DataOutputStream output = new DataOutputStream(connection.getOutputStream());
        output.writeBytes(anchor);
        output.writeBytes(CP1);
        output.writeBytes(CP2);
        output.writeBytes(CP3);
4

0 回答 0