Class RequestBuilder (1.60.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

GoogleApisRequests

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
TypeDescription
Uri

Method

public string Method { get; set; }

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

Property Value
TypeDescription
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 Google.Apis.Requests.RequestBuilder.PathParameters dictionary.

Property Value
TypeDescription
string

Methods

AddParameter(RequestParameterType, string, string)

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

Adds a parameter value.

Parameters
NameDescription
typeRequestParameterType

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

namestring

Parameter name.

valuestring

Parameter value.

BuildUri()

public Uri BuildUri()

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

Returns
TypeDescription
Uri

CreateRequest()

public HttpRequestMessage CreateRequest()

Creates a new HTTP request message.

Returns
TypeDescription
HttpRequestMessage

Extension Method