Skip to content

Function Http

Chris Hunt edited this page May 23, 2016 · 1 revision

Http

SYNOPSIS

Test a Web Service.

DESCRIPTION

Test that a Web Service is reachable and optionally returns specific content.

PARAMETERS

Target [String]

[Parameter(
  Mandatory = $true,
  Position = 2,
  ParameterSetName = 'Set 1')]

Property [String]

[Parameter(
  Mandatory = $true,
  Position = 3,
  ParameterSetName = 'Set 1')]

Should [ScriptBlock]

[Parameter(
  Mandatory = $true,
  Position = 4,
  ParameterSetName = 'Set 1')]

Assertions

Assertions: Be, BeExactly, Match, MatchExactly

EXAMPLES

-------------------------- EXAMPLE 1 --------------------------

Http http://localhost StatusCode { Should Be 200 }

-------------------------- EXAMPLE 2 --------------------------

Http http://localhost RawContent { Should Match 'X-Powered-By: ASP.NET' }

-------------------------- EXAMPLE 3 --------------------------

Http http://localhost RawContent { Should Not Match 'X-Powered-By: Cobal' }