Package com.azure.android.core.http
Class HttpPipelineBuilder
- java.lang.Object
 - 
- com.azure.android.core.http.HttpPipelineBuilder
 
 
- 
public class HttpPipelineBuilder extends java.lang.ObjectThis class provides a fluent builder API to help aid the configuration and instantiation of theHttpPipeline, callingbuildconstructs an instance of the pipeline.A pipeline is configured with a HttpClient that sends the request, if no client is set a default is used. A pipeline may be configured with a list of policies that are applied to each request.
Create a pipeline without configuration
new HttpPipelineBuilder() .build();Create a pipeline using the default HTTP client and a retry policy
new HttpPipelineBuilder() .httpClient(HttpClient.createDefault()) .policies(new RetryPolicy()) .build();- See Also:
 HttpPipeline
 
- 
- 
Constructor Summary
Constructors Constructor Description HttpPipelineBuilder()Creates a new instance of HttpPipelineBuilder that can configure options for theHttpPipelinebefore creating an instance of it. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpPipelinebuild()Creates aHttpPipelinebased on options set in the Builder.HttpPipelineBuilderhttpClient(HttpClient httpClient)Sets the HttpClient that the pipeline will use to send requests.HttpPipelineBuilderpolicies(HttpPipelinePolicy... policies)Addspoliciesto the set of policies that the pipeline will use when sending requests. 
 - 
 
- 
- 
Constructor Detail
- 
HttpPipelineBuilder
public HttpPipelineBuilder()
Creates a new instance of HttpPipelineBuilder that can configure options for theHttpPipelinebefore creating an instance of it. 
 - 
 
- 
Method Detail
- 
build
public HttpPipeline build()
Creates aHttpPipelinebased on options set in the Builder. Every timebuild()is called, a new instance ofHttpPipelineis created. If HttpClient is not set then thedefault HttpClientis used.- Returns:
 - A HttpPipeline with the options set from the builder.
 
 
- 
httpClient
public HttpPipelineBuilder httpClient(HttpClient httpClient)
Sets the HttpClient that the pipeline will use to send requests.- Parameters:
 httpClient- The HttpClient the pipeline will use when sending requests.- Returns:
 - The updated HttpPipelineBuilder object.
 
 
- 
policies
public HttpPipelineBuilder policies(HttpPipelinePolicy... policies)
Addspoliciesto the set of policies that the pipeline will use when sending requests.- Parameters:
 policies- Policies to add to the policy set.- Returns:
 - The updated HttpPipelineBuilder object.
 
 
 - 
 
 -