Package htsjdk.samtools.util.htsget

# Class HtsgetPOSTRequest

java.lang.Object
htsjdk.samtools.util.htsget.HtsgetRequest
htsjdk.samtools.util.htsget.HtsgetPOSTRequest

public class HtsgetPOSTRequest extends HtsgetRequest
Builder for an htsget POST request that allows opening a connection using the request after validating that it is properly formed.

This class is experimental and subject to change as the POST api evolves.

See https://github.com/samtools/hts-specs/pull/285 for the API specification.

## Field Summary

### Fields inherited from class htsjdk.samtools.util.htsget.HtsgetRequest

`ACCEPT_TYPE, dataClass, fields, format, interval, notags, PROTOCOL_VERSION, tags, UNMAPPED_UNPLACED_INTERVAL`

## Constructor Summary

Constructors
Constructor
Description
`HtsgetPOSTRequest(HtsgetRequest req)`
`HtsgetPOSTRequest(URI endpoint)`
Construct an HtsgetRequest from a URI identifying a valid resource on a htsget server

## Method Summary

Modifier and Type
Method
Description
`void`
`addInterval(Locatable interval)`
`void`
`addIntervals(Collection<Locatable> intervals)`
`protected HttpURLConnection`
`getConnection()`
`org.kordamp.json.JSONObject`
`queryBody()`
`void`
`setInterval(Locatable interval)`
`URI`
`toURI()`
Convert request to a URI which can be used to make http request for data blocks
`void`
`validateRequest()`
Validates that the user query obeys htsget spec
`HtsgetPOSTRequest`
`withDataClass(HtsgetClass dataClass)`
`HtsgetPOSTRequest`
`withField(HtsgetRequestField field)`
`HtsgetPOSTRequest`
`withFields(Collection<HtsgetRequestField> fields)`
`HtsgetPOSTRequest`
`withFormat(HtsgetFormat format)`
`HtsgetPOSTRequest`
`withInterval(Locatable interval)`
`HtsgetPOSTRequest`
`withIntervals(Collection<Locatable> intervals)`
`HtsgetPOSTRequest`
`withNotag(String notag)`
`HtsgetPOSTRequest`
`withNotags(Collection<String> notags)`
`HtsgetPOSTRequest`
`withTag(String tag)`
`HtsgetPOSTRequest`
`withTags(Collection<String> tags)`

### Methods inherited from class htsjdk.samtools.util.htsget.HtsgetRequest

`addField, addFields, addNotag, addNotags, addTag, addTags, getDataClass, getEndpoint, getFields, getFormat, getInterval, getNoTags, getResponse, getTags, setDataClass, setFormat`

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

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

## Constructor Details

### HtsgetPOSTRequest

public HtsgetPOSTRequest(URI endpoint)
Construct an HtsgetRequest from a URI identifying a valid resource on a htsget server

Parameters:
  `endpoint` - the full URI including both server path and the ID of the htsget resource, without the filtering parameters defined in the htsget spec such as start or referenceName

### HtsgetPOSTRequest

public HtsgetPOSTRequest(HtsgetRequest req)

## Method Details

### setInterval

public void setInterval(Locatable interval)

Overrides:
  `setInterval` in class `HtsgetRequest`

### addInterval

public void addInterval(Locatable interval)

### addIntervals

public void addIntervals(Collection<Locatable> intervals)

### withFormat

public HtsgetPOSTRequest withFormat(HtsgetFormat format)

Overrides:
  `withFormat` in class `HtsgetRequest`

### withDataClass

public HtsgetPOSTRequest withDataClass(HtsgetClass dataClass)

Overrides:
  `withDataClass` in class `HtsgetRequest`

### withInterval

public HtsgetPOSTRequest withInterval(Locatable interval)

Overrides:
  `withInterval` in class `HtsgetRequest`

### withIntervals

public HtsgetPOSTRequest withIntervals(Collection<Locatable> intervals)

### withField

public HtsgetPOSTRequest withField(HtsgetRequestField field)

Overrides:
  `withField` in class `HtsgetRequest`

### withFields

public HtsgetPOSTRequest withFields(Collection<HtsgetRequestField> fields)

Overrides:
  `withFields` in class `HtsgetRequest`

### withTag

public HtsgetPOSTRequest withTag(String tag)

Overrides:
  `withTag` in class `HtsgetRequest`

### withTags

public HtsgetPOSTRequest withTags(Collection<String> tags)

Overrides:
  `withTags` in class `HtsgetRequest`

### withNotag

public HtsgetPOSTRequest withNotag(String notag)

Overrides:
  `withNotag` in class `HtsgetRequest`

### withNotags

public HtsgetPOSTRequest withNotags(Collection<String> notags)

Overrides:
  `withNotags` in class `HtsgetRequest`

### validateRequest

public void validateRequest()
Description copied from class: `HtsgetRequest`
Validates that the user query obeys htsget spec

Overrides:
  `validateRequest` in class `HtsgetRequest`

### toURI

public URI toURI()
Description copied from class: `HtsgetRequest`
Convert request to a URI which can be used to make http request for data blocks

Overrides:
  `toURI` in class `HtsgetRequest`

### queryBody

public org.kordamp.json.JSONObject queryBody()

### getConnection

protected HttpURLConnection getConnection()

Overrides:
  `getConnection` in class `HtsgetRequest`