我想通过URL发送一些JSON数据,请任何人告诉我如何做到这一点。 我的网址如下所示:
<div class="wrapper">
<div class="try1">DUE DILIGENCE EXPIRATION</div>
</div>
答案 0 :(得分:0)
您可以使用apache.http.client库发送数据:
RequestBuilder rb = RequestBuilder.post();
rb.setUri(url);
rb.addHeader("content-type", "application/json");
rb.addHeader("Accept","*/*");
rb.setEntity(new StringEntity(jsonString))
CloseableHttpClient httpclient = HttpClients.createDefault();
CloseableHttpResponse httpResponse = httpClient.execute(rb.build());
jsonString在json中的数据