Commit 449845fe517b0a91f1fd5aa8725e86ae16b88245
Committed by
Andrew Shvayka
1 parent
4ab3db85
No body for REST API Call Node on GET method
Showing
1 changed file
with
7 additions
and
1 deletions
... | ... | @@ -174,7 +174,13 @@ public class TbHttpClient { |
174 | 174 | String endpointUrl = TbNodeUtils.processPattern(config.getRestEndpointUrlPattern(), msg); |
175 | 175 | HttpHeaders headers = prepareHeaders(msg); |
176 | 176 | HttpMethod method = HttpMethod.valueOf(config.getRequestMethod()); |
177 | - HttpEntity<String> entity = new HttpEntity<>(msg.getData(), headers); | |
177 | + HttpEntity<String> entity; | |
178 | + if(HttpMethod.GET.equals(method) || HttpMethod.HEAD.equals(method) || | |
179 | + HttpMethod.OPTIONS.equals(method) || HttpMethod.TRACE.equals(method)) { | |
180 | + entity = new HttpEntity<>(headers); | |
181 | + } else { | |
182 | + entity = new HttpEntity<>(msg.getData(), headers); | |
183 | + } | |
178 | 184 | |
179 | 185 | ListenableFuture<ResponseEntity<String>> future = httpClient.exchange( |
180 | 186 | endpointUrl, method, entity, String.class); | ... | ... |