Azure / azure-libraries-for-java

Azure Management Libraries for Java
https://docs.microsoft.com/en-us/java/azure/
MIT License
94 stars 98 forks source link

ReturnRequestIdHeaderInterceptor #1254

Closed weidongxu-microsoft closed 4 years ago

weidongxu-microsoft commented 4 years ago

to request server put x-ms-client-request-id in response

Sample usage:

        Azure azure = Azure.configure()
                .withInterceptor(new ReturnRequestIdHeaderInterceptor())
                .authenticate(...)
                ...

Header can be accessed in Exception.

        exception.response().headers().get("x-ms-client-request-id")