public class RequestBuilderUtility class for building a URI using BuildUri() or a HTTP request using CreateRequest() from the query and path parameters of a REST call.
Namespace
Google.Apis.RequestsAssembly
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 |
|
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 |
RequestParameterTypeType of the parameter (must be 'Path' or 'Query'). |
name |
stringParameter name. |
value |
stringParameter 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 |
|