0-byte body on sdk 6.12 with android when using HttpLoggingInterceptor
I have the issue that the sdk posts no body (again). Related to https://github.com/microsoftgraph/msgraph-sdk-java/issues/1972 and https://github.com/microsoftgraph/msgraph-sdk-java/issues/1872 that i have posted before.
I can finally reproduce the issue, it occurs when i activate our HttpLoggingInterceptor
sdk is 6.12.0 on android 10, used logging-interceptor is the current version, 4.12.0
Here is our code to create the GraphServiceClient with the logger (simplified):
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor(System.out::println); loggingInterceptor.level(HttpLoggingInterceptor.Level.BODY); OkHttpClient.Builder builder = GraphClientFactory.create(); builder.addInterceptor(loggingInterceptor); OkHttpClient okHttpClient = builder.build(); GraphServiceClient client = new GraphServiceClient(authProvider, okHttpClient);
If i set the Level to BASIC or NONE, the request works. If i change it to BODY again, it fails.
I am trying to retrieve user availability: `--> POST https://graph.microsoft.com/v1.0/me/calendar/getSchedule Content-Length: 227 content-type: application/json authorization: Bearer prefer: outlook.timezone="UTC" accept: application/json SdkVersion: graph-java, graph-java-core/3.1.12 (featureUsage=1203; android/29) client-request-id: f0b3a2d1-506f-4bbd-9b03-8ba3b71a8085 User-Agent: kiota-java/1.1.12
{"AvailabilityViewInterval":60,"EndTime":{"dateTime":"2024-06-05T13:00:00.000","timeZone":"UTC"},"Schedules":["[email protected]","[email protected]"],"StartTime":{"dateTime":"2024-06-05T12:00:00.000","timeZone":"UTC"}} --> END POST (0-byte body)`
Is there a different way to log headers and body?