@@ -93,9 +93,11 @@ private void setRequestHeaderOfAccept(Map<String, String> headers, RequestBody b
93
93
accepts .add (userAcceptValue );
94
94
}
95
95
// 2. set accept header same with content-type
96
- final String contentType = body .contentType ().toString ();
97
- if (contentType != null && contentType .length () > 0 ) {
98
- accepts .add (contentType );
96
+ if (body .contentType () != null ) {
97
+ final String contentType = Objects .requireNonNull (body .contentType ()).toString ();
98
+ if (contentType .length () > 0 ) {
99
+ accepts .add (contentType );
100
+ }
99
101
}
100
102
// 3. add */* at last
101
103
accepts .add (ACCEPT_ALL );
@@ -199,6 +201,10 @@ private <T> CompletableFuture<HttpResponse<T>> doAsyncInvoke(String method,
199
201
200
202
if (HttpExtension .GET .getMethod ().toString ().equals (httpMethod )) {
201
203
// TODO: 2021/11/30 append urlParameters to url
204
+ if (logger .isWarnEnabled ()) {
205
+ logger .warn ("[Capa.Rpc.Client.http] [AwsCapaHttp.doAsyncInvoke] GET not supported now, urlParameters[{}]" ,
206
+ urlParameters );
207
+ }
202
208
}
203
209
204
210
// async invoke
@@ -210,7 +216,7 @@ private <T> CompletableFuture<HttpResponse<T>> doAsyncInvoke(String method,
210
216
type );
211
217
asyncInvoke0 .exceptionally (throwable -> {
212
218
if (logger .isWarnEnabled ()) {
213
- logger .warn ("[AwsCapaHttp] async invoke error" , throwable );
219
+ logger .warn ("[Capa.Rpc.Client.http] [ AwsCapaHttp.doAsyncInvoke ] async invoke error" , throwable );
214
220
}
215
221
throw new CapaException (CapaErrorContext .DEPENDENT_SERVICE_ERROR , throwable );
216
222
});
@@ -229,6 +235,11 @@ private <T> CompletableFuture<HttpResponse<T>> invokeHttp(String url,
229
235
230
236
Headers header = getRequestHeaderWithParams (headers );
231
237
238
+ if (logger .isDebugEnabled ()) {
239
+ logger .debug ("[Capa.Rpc.Client.http] [AwsCapaHttp.invokeHttp] final request url[{}] header[{}] httpMethod[{}]" ,
240
+ url , header , httpMethod );
241
+ }
242
+
232
243
// make http request
233
244
Request request = new Request .Builder ()
234
245
.url (url )
0 commit comments