# HttpDataSource.RequestProperties

# HttpDataSource.RequestProperties

Artifact:[androidx.media3:media3-datasource](https://developer.android.com/jetpack/androidx/releases/media3)  
[View Source](https://cs.android.com/search?q=file:androidx/media3/datasource/HttpDataSource.java+class:androidx.media3.datasource.HttpDataSource.RequestProperties)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/datasource/HttpDataSource.RequestProperties "View this page in Java")

<br />

```
@UnstableApi
class HttpDataSource.RequestProperties
```

<br />

*** ** * ** ***

Stores HTTP request properties (aka HTTP headers) and provides methods to modify the headers in a thread safe way to avoid the potential of creating snapshots of an inconsistent or unintended state.

## Summary

|                                                                 ### Public constructors                                                                 |
|---------------------------------------------------------------------------------------------------------------------------------------------------------|
| [RequestProperties](https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpDataSource.RequestProperties#RequestProperties())`()` |

|                                                                                                                                                                                     ### Public functions                                                                                                                                                                                     |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `synchronized `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                                                 | [clear](https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpDataSource.RequestProperties#clear())`()` Clears all request properties.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `synchronized `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                                                 | [clearAndSet](https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpDataSource.RequestProperties#clearAndSet(java.util.Map<java.lang.String,java.lang.String>))`(properties: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)`)`[Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!>!)` Removes all properties previously existing and sets the keys and values of the map. |
| `synchronized (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)`)`[Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!>!` | [getSnapshot](https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpDataSource.RequestProperties#getSnapshot())`()` Gets a snapshot of the request properties.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `synchronized `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                                                 | [remove](https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpDataSource.RequestProperties#remove(java.lang.String))`(name: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!)` Removes a request property by name.                                                                                                                                                                                                                                                                                                                                                                                          |
| `synchronized `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                                                 | [set](https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpDataSource.RequestProperties#set(java.util.Map<java.lang.String,java.lang.String>))`(properties: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)`)`[Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!>!)` Sets the keys and values contained in the map.                                                      |
| `synchronized `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                                                 | [set](https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpDataSource.RequestProperties#set(java.lang.String,java.lang.String))`(name: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, value: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!)` Sets the specified property`value`for the specified`name`.                                                                                                                                                                                                                                                           |

## Public constructors

### RequestProperties

```
RequestProperties()
```  

## Public functions

### clear

```
synchronized fun clear(): Unit
```

Clears all request properties.  

### clearAndSet

```
synchronized fun clearAndSet(properties: (Mutable)Map<String!, String!>!): Unit
```

Removes all properties previously existing and sets the keys and values of the map.  

|                                                                                                                                                                                         Parameters                                                                                                                                                                                          |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| `properties: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)`)`[Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!>!` | The request properties. |

### getSnapshot

```
synchronized fun getSnapshot(): (Mutable)Map<String!, String!>!
```

Gets a snapshot of the request properties.  

|                                                                                                                                                                                     Returns                                                                                                                                                                                     |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------|
| `(`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)`)`[Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!>!` | A snapshot of the request properties. |

### remove

```
synchronized fun remove(name: String!): Unit
```

Removes a request property by name.  

|                                          Parameters                                          |
|----------------------------------------------------------------------------------------------|---------------------------------------------|
| `name: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | The name of the request property to remove. |

### set

```
synchronized fun set(properties: (Mutable)Map<String!, String!>!): Unit
```

Sets the keys and values contained in the map. If a property previously existed, the old value is replaced by the specified value. If a property previously existed and is not in the map, the property is left unchanged.  

|                                                                                                                                                                                         Parameters                                                                                                                                                                                          |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| `properties: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)`)`[Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!>!` | The request properties. |

### set

```
synchronized fun set(name: String!, value: String!): Unit
```

Sets the specified property`value`for the specified`name`. If a property for this name previously existed, the old value is replaced by the specified value.  

|                                          Parameters                                           |
|-----------------------------------------------------------------------------------------------|------------------------------------|
| `name: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`  | The name of the request property.  |
| `value: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | The value of the request property. |