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