12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpcore</artifactId>
- <version>4.4.10</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- <version>4.5.6</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpmime</artifactId>
- <version>4.5.6</version>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>fluent-hc</artifactId>
- <version>4.5.6</version>
- </dependency>
- String port = ConfigurationUtil.getUserConfigSingleValue("DataRelease", "Service", "Publish-Port");
- String drUrl = "http://" + ip + ":" + port + "/datarelease/api/dr/meta/rowpermission";
- try {
- HttpResponse httpResponse = Request.Post(drUrl)
- .bodyForm(Form.form().add("resApplyId", resApplyId).build())
- .socketTimeout(3000)
- .connectTimeout(3000)
- .execute().returnResponse();
- if (httpResponse.getStatusLine().getStatusCode() == 200) {
- return "1";
- } else {
- return "-1";
- }
- } catch (IOException e) {
- log.error(e.getMessage(), e);
- return "-1";
- }
|