Ads API .NET library
|
Utility class for various HTTP tasks. More...
Static Public Member Functions | |
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.
|
inlinestatic |
Builds an HTTP PUT request with a Range header.
url | The URL. |
contentLength | Length of the content. |
range | The range heaer notation. |
config | The configuration instance for customizing the connection settings. |
System.ArgumentNullException | Thrown if config is null. |
Referenced by Google.Api.Ads.AdWords.Util.BatchJob.BatchJobUtilitiesBase.UploadChunk().
|
inlinestatic |
Builds an HTTP request with a specified method.
url | The URL. |
method | The HTTP method. |
config | The configuration instance for customizing the connection settings. |
System.ArgumentNullException | Thrown if config is null. |
References Google.Api.Ads.Common.Lib.AppConfig.EnableGzipCompression.
|
inlinestatic |
Gets the error response body.
e | The web exception. |
|
inlinestatic |
Updates a URL endpoint with a new host.
originalUri | The original URI. |
newHost | The new host. |
|
inlinestatic |
Attempts to write a post body and log the request.
request | The request. |
postBody | The post body. |
service | The service making this request. |
logEntry | The log entry. |
headersToMask | The headers to mask. |