# Interface IClientServiceRequest (1.73.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [1.73.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Requests.IClientServiceRequest)
- [1.69.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.69.0/Google.Apis.Requests.IClientServiceRequest)
- [1.68.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.68.0/Google.Apis.Requests.IClientServiceRequest)
- [1.60.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.60.0/Google.Apis.Requests.IClientServiceRequest)
- [1.59.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.59.0/Google.Apis.Requests.IClientServiceRequest)
- [1.55.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.55.0/Google.Apis.Requests.IClientServiceRequest)
- [1.50.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.50.0/Google.Apis.Requests.IClientServiceRequest)

    public interface IClientServiceRequest

A client service request which supports both sync and async execution to get the stream.

## Namespace

[Google.Apis.Requests](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Requests)

## Assembly

Google.Apis.dll

## Properties

### HttpMethod

    string HttpMethod { get; }

Gets the HTTP method of this request.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### MethodName

    string MethodName { get; }

Gets the name of the method to which this request belongs.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### RequestParameters

    IDictionary<string, IParameter> RequestParameters { get; }

Gets the parameters information for this specific request.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.idictionary-2https://learn.microsoft.com/dotnet/api/system.stringhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Discovery.IParameter` |   |

### RestPath

    string RestPath { get; }

Gets the rest path of this request.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Service

    IClientService Service { get; }

Gets the service which is related to this request.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Services.IClientService` |   |

## Methods

### CreateRequest(bool?)

    HttpRequestMessage CreateRequest(bool? overrideGZipEnabled = null)

Creates a HTTP request message with all path and query parameters, ETag, etc.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `overrideGZipEnabled` | `https://learn.microsoft.com/dotnet/api/system.boolean` If `null` use the service default GZip behavior. Otherwise indicates if GZip is enabled or disabled. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage` |   |

### ExecuteAsStream()

    Stream ExecuteAsStream()

Executes the request and returns the result stream.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.io.stream` |   |

### ExecuteAsStreamAsync()

    Task<Stream> ExecuteAsStreamAsync()

Executes the request asynchronously and returns the result stream.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://learn.microsoft.com/dotnet/api/system.io.stream` |   |

### ExecuteAsStreamAsync(CancellationToken)

    Task<Stream> ExecuteAsStreamAsync(CancellationToken cancellationToken)

Executes the request asynchronously and returns the result stream.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A cancellation token to cancel operation. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://learn.microsoft.com/dotnet/api/system.io.stream` |   |

## Extension Method

[Utilities.ThrowIfNull\<T\>(T, string)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Util.Utilities#Google_Apis_Util_Utilities_ThrowIfNull__1___0_System_String_)