Package com.azure.core.http.policy
Interface RedirectStrategy
-
- All Known Implementing Classes:
DefaultRedirectStrategy
public interface RedirectStrategy
The interface for determining theredirect strategy
used inRedirectPolicy
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HttpRequest
createRedirectRequest(HttpResponse httpResponse)
Creates anrequest
for the redirect attempt.int
getMaxAttempts()
Max number of redirect attempts to be made.boolean
shouldAttemptRedirect(HttpPipelineCallContext context, HttpResponse httpResponse, int tryCount, Set<String> attemptedRedirectUrls)
Determines if the url should be redirected between each try.
-
-
-
Method Detail
-
getMaxAttempts
int getMaxAttempts()
Max number of redirect attempts to be made.- Returns:
- The max number of redirect attempts.
-
shouldAttemptRedirect
boolean shouldAttemptRedirect(HttpPipelineCallContext context, HttpResponse httpResponse, int tryCount, Set<String> attemptedRedirectUrls)
Determines if the url should be redirected between each try.- Parameters:
context
- theHTTP pipeline context
.httpResponse
- theHttpRequest
containing the redirect url present in the response headerstryCount
- redirect attempts so farattemptedRedirectUrls
- attempted redirect locations used so far.- Returns:
true
if the request should be redirected,false
otherwise
-
createRedirectRequest
HttpRequest createRedirectRequest(HttpResponse httpResponse)
Creates anrequest
for the redirect attempt.- Parameters:
httpResponse
- theHttpResponse
containing the redirect url present in the response headers- Returns:
- the modified
HttpRequest
to redirect the incoming request.
-
-