RestProxy Class
- java.
lang. Object - com.
azure. core. http. rest. RestProxy
- com.
Implements
public final class RestProxy
implements InvocationHandler
RestProxy is a type that creates a proxy implementation for an interface describing REST API methods. It can create proxy implementations for interfaces with methods that return deserialized Java objects as well as asynchronous Single objects that resolve to a deserialized Java object.
RestProxy uses the provided HttpPipeline and SerializerAdapter to send HTTP requests and convert response bodies to POJOs.
It also provides methods to send the provided request asynchronously, applying any request policies provided to the HttpClient instance.
RestProxy is useful when you want to create a proxy implementation for an interface describing REST API methods.
Method Summary
Modifier and Type | Method and Description |
---|---|
static A |
create(Class<A> swaggerInterface)
Create a proxy implementation of the provided Swagger interface. |
static A |
create(Class<A> swaggerInterface, HttpPipeline httpPipeline)
Create a proxy implementation of the provided Swagger interface. |
static A |
create(Class<A> swaggerInterface, HttpPipeline httpPipeline, SerializerAdapter serializer)
Create a proxy implementation of the provided Swagger interface. |
Object | invoke(Object proxy, Method method, Object[] args) |
Mono<Http |
send(HttpRequest request, Context contextData)
Send the provided request asynchronously, applying any request policies provided to the Http |
Methods inherited from java.lang.Object
Method Details
create
public static A create(Class swaggerInterface)
Create a proxy implementation of the provided Swagger interface.
Parameters:
Returns:
create
public static A create(Class swaggerInterface, HttpPipeline httpPipeline)
Create a proxy implementation of the provided Swagger interface.
Parameters:
Returns:
create
public static A create(Class swaggerInterface, HttpPipeline httpPipeline, SerializerAdapter serializer)
Create a proxy implementation of the provided Swagger interface.
Parameters:
Returns:
invoke
public Object invoke(Object proxy, Method method, Object[] args)
Parameters:
send
public Mono
Send the provided request asynchronously, applying any request policies provided to the HttpClient instance.
Parameters:
Returns:
Applies to
Azure SDK for Java
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for