mirror of https://github.com/dapr/java-sdk.git
Fixing issue regarding GET and DELETE method (#76)
This commit is contained in:
parent
858f28a34b
commit
eb7d1b62cf
|
@ -125,8 +125,14 @@ class DaprHttp {
|
|||
|
||||
Request.Builder requestBuilder = new Request.Builder()
|
||||
.url(new URL(this.baseUrl + urlString))
|
||||
.method(method, body)
|
||||
.addHeader(Constants.HEADER_DAPR_REQUEST_ID, requestId);
|
||||
if (Constants.defaultHttpMethodSupported.GET.name().equals(method)) {
|
||||
requestBuilder.get();
|
||||
} else if (Constants.defaultHttpMethodSupported.DELETE.name().equals(method)) {
|
||||
requestBuilder.delete();
|
||||
} else {
|
||||
requestBuilder.method(method, body);
|
||||
}
|
||||
if (headers != null) {
|
||||
Optional.ofNullable(headers.entrySet()).orElse(Collections.emptySet()).stream()
|
||||
.forEach(header -> {
|
||||
|
|
Loading…
Reference in New Issue