public class RequestBuilder : object
Utility 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 Google.Apis.Requests.RequestBuilder.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 | RequestParameterType Type of the parameter (must be 'Path' or 'Query'). |
name | String Parameter name. |
value | String Parameter 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 |