diff --git a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/KiotaClientFactory.java b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/KiotaClientFactory.java index 3b810e94..d9762f56 100644 --- a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/KiotaClientFactory.java +++ b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/KiotaClientFactory.java @@ -40,6 +40,16 @@ private KiotaClientFactory() {} return create(createDefaultInterceptors()); } + /** + * Creates an OkHttpClient Builder with the default configuration and middleware options. + * @param requestOptions The request options to use for the interceptors. + * @return an OkHttpClient Builder instance. + */ + @Nonnull public static OkHttpClient.Builder create(@Nonnull final RequestOption[] requestOptions) { + Objects.requireNonNull(requestOptions, "parameter requestOptions cannot be null"); + return create(createDefaultInterceptors(Arrays.asList(requestOptions))); + } + /** * Creates an OkHttpClient Builder with the default configuration and middleware. * @param interceptors The interceptors to add to the client. Will default to createDefaultInterceptors() if null.