Revision 61374
Added by Konstantinos Triantafyllou almost 3 years ago
HttpUtils.java | ||
---|---|---|
33 | 33 |
headers.setContentType(MediaType.APPLICATION_JSON); |
34 | 34 |
HttpEntity<String> request = new HttpEntity<>(body.toString(), headers); |
35 | 35 |
ResponseEntity<String> responseEntity = restTemplate.exchange(issuer + path, HttpMethod.POST, request, String.class); |
36 |
if(responseEntity.getBody() != null) { |
|
36 |
if (responseEntity.getBody() != null) {
|
|
37 | 37 |
return new JsonParser().parse(responseEntity.getBody()); |
38 | 38 |
} else { |
39 | 39 |
return null; |
... | ... | |
46 | 46 |
headers.setContentType(MediaType.APPLICATION_JSON); |
47 | 47 |
HttpEntity<String> request = new HttpEntity<>(body.toString(), headers); |
48 | 48 |
ResponseEntity<String> responseEntity = restTemplate.exchange(issuer + path, HttpMethod.PUT, request, String.class); |
49 |
if(responseEntity.getBody() != null) { |
|
49 |
if (responseEntity.getBody() != null) {
|
|
50 | 50 |
return new JsonParser().parse(responseEntity.getBody()); |
51 | 51 |
} else { |
52 | 52 |
return null; |
... | ... | |
58 | 58 |
String url = issuer + path + ((params != null) ? createParams(params) : null); |
59 | 59 |
ResponseEntity<String> responseEntity = restTemplate.exchange |
60 | 60 |
(url, HttpMethod.GET, new HttpEntity<>(createHeaders(user, password)), String.class); |
61 |
if(responseEntity.getBody() != null) { |
|
61 |
if (responseEntity.getBody() != null) {
|
|
62 | 62 |
return new JsonParser().parse(responseEntity.getBody()); |
63 | 63 |
} else { |
64 | 64 |
return null; |
... | ... | |
70 | 70 |
String url = issuer + path; |
71 | 71 |
ResponseEntity<String> responseEntity = restTemplate.exchange |
72 | 72 |
(url, HttpMethod.DELETE, new HttpEntity<>(createHeaders(user, password)), String.class); |
73 |
if(responseEntity.getBody() != null) { |
|
73 |
if (responseEntity.getBody() != null) {
|
|
74 | 74 |
return new JsonParser().parse(responseEntity.getBody()); |
75 | 75 |
} else { |
76 | 76 |
return null; |
... | ... | |
82 | 82 |
StringBuilder ret = new StringBuilder("?"); |
83 | 83 |
int count = 0; |
84 | 84 |
for (Map.Entry<String, String> param : params.entrySet()) { |
85 |
ret.append(param.getKey()).append("=").append(param.getValue()); |
|
85 |
ret.append(param.getKey()).append("="); |
|
86 |
ret.append(param.getValue()); |
|
86 | 87 |
count++; |
87 | 88 |
if (count != params.entrySet().size()) { |
88 | 89 |
ret.append("&"); |
Also available in: Unified diff
Update dnet-login-core to 1.0.2. Create role returns id of created role