HttpWebRequest Class | MSBuild Extension Pack Help 4.0.12.0 |
Valid TaskActions are:
GetResponse (Required: Url Optional: ContentType, Timeout, SkipSslCertificateValidation, Retries, RetryInterval, UseIntegratedAuthentication, UserName, UserPassword Output: Response, Status)
Post (Required: Url Optional: ContentType, Timeout, RequestContent, SkipSslCertificateValidation, Retries, RetryInterval, UseIntegratedAuthentication, UserName, UserPassword Output: Response, Status)
Remote Execution Support: NA
Inheritance Hierarchy
MSBuild.ExtensionPackBaseTask
MSBuild.ExtensionPack.WebHttpWebRequest
Namespace: MSBuild.ExtensionPack.Web
Assembly: MSBuild.ExtensionPack (in MSBuild.ExtensionPack.dll) Version: 4.0.0.0
The HttpWebRequest type exposes the following members.
Constructors
Name | Description | |
---|---|---|
HttpWebRequest |
Properties
Name | Description | |
---|---|---|
ContentType |
The content type of the request. By default, it is "application/x-www-form-urlencoded" (used for classic HTTP POST) for Post and null for GetResponse.
| |
RequestContent |
The content of the request. For classic HTTP POST, format is several [key]=[value] separated by "&". Could be SOAP for example if ContentType is SOAP.
| |
Response | ||
Retries |
The number of times the request should be retried before failing.
| |
RetryInterval |
The number of milliseconds between retry attempts. Default is 0.
| |
SkipSslCertificateValidation |
Set to true to accept all SSL certificates.
| |
Status |
Contains the StatusDescription for successful requests. Contains the Status when encountering a WebException.
| |
Timeout |
Sets the number of milliseconds to wait before the request times out. The default value is 100,000 milliseconds (100 seconds).
| |
Url |
Sets the name of the AppPool. Required.
| |
UseIntegratedAuthentication |
The number of milliseconds between retry attempts. Default is 0.
|
Examples
<Project ToolsVersion="4.0" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <TPath>$(MSBuildProjectDirectory)\..\MSBuild.ExtensionPack.tasks</TPath> <TPath Condition="Exists('$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks')">$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks</TPath> </PropertyGroup> <Import Project="$(TPath)"/> <Target Name="Default"> <MSBuild.ExtensionPack.Web.HttpWebRequest TaskAction="GetResponse" Url="http://www.freetodev.com"> <Output TaskParameter="Response" ItemName="ResponseDetail"/> <Output TaskParameter="Status" PropertyName="ResponseStatus"/> </MSBuild.ExtensionPack.Web.HttpWebRequest> <Message Text="Status: $(ResponseStatus)"/> <Message Text="StatusDescription: %(ResponseDetail.StatusDescription)"/> <Message Text="StatusCode: %(ResponseDetail.StatusCode)"/> <Message Text="CharacterSet: %(ResponseDetail.CharacterSet)"/> <Message Text="ProtocolVersion: %(ResponseDetail.ProtocolVersion)"/> <Message Text="ResponseUri: %(ResponseDetail.ResponseUri)"/> <Message Text="Server: %(ResponseDetail.Server)"/> <Message Text="ResponseText: %(ResponseDetail.ResponseText)"/> </Target> </Project>
See Also