Class RequestBuilder (1.68.0)

public class RequestBuilder

Utility class for building a URI using BuildUri() or a HTTP request using CreateRequest() from the query and path parameters of a REST call.

Inheritance

object > RequestBuilder

Namespace

Google.Apis.Requests

Assembly

Google.Apis.Core.dll

Constructors

RequestBuilder()

public RequestBuilder()

Construct a new request builder.

Properties

BaseUri

public Uri BaseUri { get; set; }

The base URI for this request (usually applies to the service itself).

Property Value
Type Description
Uri

Method

public string Method { get; set; }

The HTTP method used for this request (such as GET, PUT, POST, etc...).

Property Value
Type Description
string
Remarks

The default Value is Get.

Path

public string Path { get; set; }

The path portion of this request. It's appended to the BaseUri and the parameters are substituted from the PathParameters dictionary.

Property Value
Type Description
string

Methods

AddParameter(RequestParameterType, string, string)

public void AddParameter(RequestParameterType type, string name, string value)

Adds a parameter value.

Parameters
Name Description
type RequestParameterType

Type of the parameter (must be 'Path' or 'Query').

name string

Parameter name.

value string

Parameter value.

BuildUri()

public Uri BuildUri()

Constructs a Uri as defined by the parts of this request builder.

Returns
Type Description
Uri

CreateRequest()

public HttpRequestMessage CreateRequest()

Creates a new HTTP request message.

Returns
Type Description
HttpRequestMessage

Extension Method