Show / Hide Table of Contents

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
System.Object
RequestBuilder
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Google.Apis.Requests
Assembly: Google.Apis.Core.dll
Syntax
public class RequestBuilder

Constructors

RequestBuilder()

Construct a new request builder.

Declaration
public RequestBuilder()

Properties

BaseUri

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

Declaration
public Uri BaseUri { get; set; }
Property Value
Type Description
System.Uri

Method

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

Declaration
public string Method { get; set; }
Property Value
Type Description
System.String
Remarks

The default Value is Get.

Path

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.

Declaration
public string Path { get; set; }
Property Value
Type Description
System.String

Methods

AddParameter(RequestParameterType, String, String)

Adds a parameter value.

Declaration
public void AddParameter(RequestParameterType type, string name, string value)
Parameters
Type Name Description
RequestParameterType type

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

System.String name

Parameter name.

System.String value

Parameter value.

BuildUri()

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

Declaration
public Uri BuildUri()
Returns
Type Description
System.Uri

CreateRequest()

Creates a new HTTP request message.

Declaration
public HttpRequestMessage CreateRequest()
Returns
Type Description
System.Net.Http.HttpRequestMessage

Extension Methods

Utilities.ThrowIfNull<T>(T, String)
Back to top