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.
Inherited Members
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 |
---|---|
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 |
---|---|
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 PathParameters dictionary.
Declaration
public string Path { get; set; }
Property Value
Type | Description |
---|---|
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'). |
string | name | Parameter name. |
string | value | Parameter value. |
BuildUri()
Constructs a Uri as defined by the parts of this request builder.
Declaration
public Uri BuildUri()
Returns
Type | Description |
---|---|
Uri |
CreateRequest()
Creates a new HTTP request message.
Declaration
public HttpRequestMessage CreateRequest()
Returns
Type | Description |
---|---|
HttpRequestMessage |