BiodbUrl {biodb} | R Documentation

## Class URL.

### Description

Class URL.

Class URL.

### Details

This class represents a URL object that can be used in requests.

### Methods

#### Public methods

- `BiodbUrl$new()`

- `BiodbUrl$getDomain()`

- `BiodbUrl$setUrl()`

- `BiodbUrl$setParam()`

- `BiodbUrl$print()`

- `BiodbUrl$toString()`

- `BiodbUrl$clone()`

#### Method `new()`

Initializer.

##### Usage

    BiodbUrl$new(url = character(), params = character(), chompExtraSlashes = TRUE)

##### Arguments

`url`

  The URL to access, as a character vector.

`params`

  The list of parameters to append to this URL.

`chompExtraSlashes`

  If set to TRUE, then slashes at the end and the beginning of each element of the url vector parameter will be removed before proper concatenation.

##### Returns

Nothing.

#### Method `getDomain()`

Gets the domain.

##### Usage

    BiodbUrl$getDomain()

##### Returns

The domain.

#### Method `setUrl()`

Sets the base URL string.

##### Usage

    BiodbUrl$setUrl(url)

##### Arguments

`url`

  The base URL string.

##### Returns

Nothing.

#### Method `setParam()`

Sets a parameter.

##### Usage

    BiodbUrl$setParam(key, value)

##### Arguments

`key`

  The parameter name.

`value`

  The value of the parameter.

##### Returns

Nothing.

#### Method `print()`

Displays information about this instance.

##### Usage

    BiodbUrl$print()

##### Returns

self as invisible.

#### Method `toString()`

Gets the URL as a string representation.

##### Usage

    BiodbUrl$toString(encode = TRUE)

##### Arguments

`encode`

  If set to TRUE, then encodes the URL.

##### Returns

The URL as a string, with all parameters and values set.

#### Method `clone()`

The objects of this class are cloneable with this method.

##### Usage

    BiodbUrl$clone(deep = FALSE)

##### Arguments

`deep`

  Whether to make a deep clone.

### See Also

`BiodbRequestScheduler`, `BiodbRequest`.

### Examples

    # Create a URL object
    u <- c("https://www.uniprot.org", "uniprot")
    p <- c(query="reviewed:yes+AND+organism:9606",
           columns='id,entry name,protein names',
           format="tab")
    url <- BiodbUrl$new(url=u, params=p)
    url$toString()

[Package biodb version 1.2.2 Index]