Utility class for various HTTP tasks.
More...
|
static WebRequest | BuildRangeRequest (string url, int contentLength, string range, AppConfig config) |
| Builds an HTTP PUT request with a Range header. More...
|
|
static WebRequest | BuildRequest (string url, string method, AppConfig config) |
| Builds an HTTP request with a specified method. More...
|
|
static string | GetErrorResponseBody (WebException e) |
| Gets the error response body. More...
|
|
static void | WritePostBodyAndLog (WebRequest request, string postBody, string service, LogEntry logEntry, ISet< string > headersToMask) |
| Attempts to write a post body and log the request. More...
|
|
static string | UpdateEndpointHostInUrl (string originalUri, string newHost) |
| Updates a URL endpoint with a new host. More...
|
|
Utility class for various HTTP tasks.
static WebRequest Google.Api.Ads.Common.Util.HttpUtilities.BuildRangeRequest |
( |
string |
url, |
|
|
int |
contentLength, |
|
|
string |
range, |
|
|
AppConfig |
config |
|
) |
| |
|
inlinestatic |
Builds an HTTP PUT request with a Range header.
- Parameters
-
url | The URL. |
contentLength | Length of the content. |
range | The range heaer notation. |
config | The configuration instance for customizing the connection settings. |
- Returns
- The web request for making HTTP call.
- Exceptions
-
System.ArgumentNullException | Thrown if config is null. |
static WebRequest Google.Api.Ads.Common.Util.HttpUtilities.BuildRequest |
( |
string |
url, |
|
|
string |
method, |
|
|
AppConfig |
config |
|
) |
| |
|
inlinestatic |
Builds an HTTP request with a specified method.
- Parameters
-
url | The URL. |
method | The HTTP method. |
config | The configuration instance for customizing the connection settings. |
- Returns
- The web request for making HTTP call.
- Exceptions
-
System.ArgumentNullException | Thrown if config is null. |
References Google.Api.Ads.Common.Lib.AppConfig.EnableGzipCompression.
static string Google.Api.Ads.Common.Util.HttpUtilities.GetErrorResponseBody |
( |
WebException |
e | ) |
|
|
inlinestatic |
Gets the error response body.
- Parameters
-
- Returns
static string Google.Api.Ads.Common.Util.HttpUtilities.UpdateEndpointHostInUrl |
( |
string |
originalUri, |
|
|
string |
newHost |
|
) |
| |
|
inlinestatic |
Updates a URL endpoint with a new host.
- Parameters
-
originalUri | The original URI. |
newHost | The new host. |
- Returns
- The updated URL.
static void Google.Api.Ads.Common.Util.HttpUtilities.WritePostBodyAndLog |
( |
WebRequest |
request, |
|
|
string |
postBody, |
|
|
string |
service, |
|
|
LogEntry |
logEntry, |
|
|
ISet< string > |
headersToMask |
|
) |
| |
|
inlinestatic |
Attempts to write a post body and log the request.
- Parameters
-
request | The request. |
postBody | The post body. |
service | The service making this request. |
logEntry | The log entry. |
headersToMask | The headers to mask. |
The documentation for this class was generated from the following file: