### YamlMime:JavaType uid: "com.azure.core.http.policy.RedirectPolicy" fullName: "com.azure.core.http.policy.RedirectPolicy" name: "RedirectPolicy" nameWithType: "RedirectPolicy" summary: "The `RedirectPolicy` class is an implementation of the interface." inheritances: - "" inheritedClassMethods: - classRef: "java.lang.Object" methodsRef: - "clone" - "equals" - "finalize" - "getClass" - "hashCode" - "notify" - "notifyAll" - "toString" - "wait" - "wait" - "wait" syntax: "public final class **RedirectPolicy**
implements " constructors: - uid: "com.azure.core.http.policy.RedirectPolicy.RedirectPolicy()" fullName: "com.azure.core.http.policy.RedirectPolicy.RedirectPolicy()" name: "RedirectPolicy()" nameWithType: "RedirectPolicy.RedirectPolicy()" summary: "Creates with default as and uses the redirect status response code (301, 302, 307, 308) to determine if this request should be redirected." syntax: "public RedirectPolicy()" desc: "Creates with default as and uses the redirect status response code (301, 302, 307, 308) to determine if this request should be redirected." - uid: "com.azure.core.http.policy.RedirectPolicy.RedirectPolicy(com.azure.core.http.policy.RedirectStrategy)" fullName: "com.azure.core.http.policy.RedirectPolicy.RedirectPolicy(RedirectStrategy redirectStrategy)" name: "RedirectPolicy(RedirectStrategy redirectStrategy)" nameWithType: "RedirectPolicy.RedirectPolicy(RedirectStrategy redirectStrategy)" summary: "Creates with the provided `redirectStrategy` as to determine if this request should be redirected." parameters: - description: "The used for redirection." name: "redirectStrategy" type: "" syntax: "public RedirectPolicy(RedirectStrategy redirectStrategy)" desc: "Creates with the provided `redirectStrategy` as to determine if this request should be redirected." methods: - uid: "com.azure.core.http.policy.RedirectPolicy.process(com.azure.core.http.HttpPipelineCallContext,com.azure.core.http.HttpPipelineNextPolicy)" fullName: "com.azure.core.http.policy.RedirectPolicy.process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)" name: "process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)" nameWithType: "RedirectPolicy.process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)" summary: "Processes provided request context and invokes the next policy." parameters: - name: "context" type: "" - name: "next" type: "" syntax: "public Mono process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)" desc: "Processes provided request context and invokes the next policy." returns: type: "Mono<>" - uid: "com.azure.core.http.policy.RedirectPolicy.processSync(com.azure.core.http.HttpPipelineCallContext,com.azure.core.http.HttpPipelineNextSyncPolicy)" fullName: "com.azure.core.http.policy.RedirectPolicy.processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next)" name: "processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next)" nameWithType: "RedirectPolicy.processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next)" summary: "Processes provided request context and invokes the next policy synchronously." parameters: - name: "context" type: "" - name: "next" type: "" syntax: "public HttpResponse processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next)" desc: "Processes provided request context and invokes the next policy synchronously." returns: type: "" type: "class" desc: "The `RedirectPolicy` class is an implementation of the interface. This policy handles HTTP redirects by determining if an HTTP request should be redirected based on the received .\n\nThis class is useful when you need to handle HTTP redirects in a pipeline. It uses a to decide if a request should be redirected. By default, it uses the , which redirects the request based on the HTTP status code of the response.\n\n**Code sample:**\n\nIn this example, a `RedirectPolicy` is constructed and can be added to a pipeline. For a request sent by the pipeline, if the server responds with a redirect status code, the request will be redirected according to the used by the `RedirectPolicy`.\n\n```java\nRedirectPolicy redirectPolicy = new RedirectPolicy();\n```" implements: - "" metadata: {} package: "com.azure.core.http.policy" artifact: com.azure:azure-core:1.52.0