Package org.apache.solr.client.solrj.request

# Class V2Request.Builder

java.lang.Object
org.apache.solr.client.solrj.request.V2Request.Builder

Enclosing class:
  `V2Request`

public static class V2Request.Builder extends Object

## Constructor Summary

Constructors
Constructor
Description
`Builder(String resource)`
Create a Builder object based on the provided resource.

## Method Summary

Modifier and Type
Method
Description
`V2Request`
`build()`
`V2Request.Builder`
`DELETE()`
`V2Request.Builder`
`forceV2(boolean flag)`
Only for testing.
`V2Request.Builder`
`GET()`
`V2Request.Builder`
`POST()`
`V2Request.Builder`
`PUT()`
`V2Request.Builder`
`useBinary(boolean flag)`
`V2Request.Builder`
`withMethod(SolrRequest.METHOD m)`
`V2Request.Builder`
`withMimeType(String mimeType)`
`V2Request.Builder`
`withParams(SolrParams params)`
`V2Request.Builder`
`withPayload(Object payload)`
`V2Request.Builder`
`withPayload(String payload)`
Set payload for request.
`V2Request.Builder`
`withResponseParser(ResponseParser parser)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Builder

public Builder(String resource)
Create a Builder object based on the provided resource. The default method is GET.

Parameters:
  `resource` - resource of the request for example "/collections" or "/cores/core-name"

## Method Details

### withMethod

public V2Request.Builder withMethod(SolrRequest.METHOD m)

### POST

public V2Request.Builder POST()

### GET

public V2Request.Builder GET()

### PUT

public V2Request.Builder PUT()

### DELETE

public V2Request.Builder DELETE()

### forceV2

public V2Request.Builder forceV2(boolean flag)
Only for testing. It's always true otherwise

### withPayload

public V2Request.Builder withPayload(String payload)
Set payload for request.

Parameters:
  `payload` - as UTF-8 String
Returns:
  builder object

### withPayload

public V2Request.Builder withPayload(Object payload)

### withParams

public V2Request.Builder withParams(SolrParams params)

### useBinary

public V2Request.Builder useBinary(boolean flag)

### withResponseParser

public V2Request.Builder withResponseParser(ResponseParser parser)

### withMimeType

public V2Request.Builder withMimeType(String mimeType)

### build

public V2Request build()