Commit graph

8 commits

Author SHA1 Message Date
Francisco Gamino 89a5c17d6b Fixing 'InFile parameter of Invoke-WebRequest doesn't work' and adding aliases (iwr for invoke-webrequest and irm for invoke-restmethod) to the web cmdlets. (#2848)
* Fixing Invoke-WebRequest InFile parameter

* Adding aliases for Invoke-RestMethod and Invoke-WebRequest

* Adding test cases for Web cmdlets -InFile parameter

* Adding tests for Invoke-WebRequest (iwr) and Invoke-RestMethod (irm) using the cmdlet aliases.

* Remove the extra leading space
2017-02-01 10:14:24 -08:00
Jason Shirk 02b5f357a2 Remove trailing whitespace (#3001) 2017-01-16 13:31:14 -08:00
Max Maximov 8be31098b1 Invoke-RestMethod cmdlet error if the response is neither JSON nor XML (#2862)
* This change fixes the Invoke-RestMethod cmdlet behavior if the input is neither xml nor json.
* test description
* fixed the failed tests
* removed some duplication
* refactoring: eliminated some double castings
* added JsonObject unit tests; enhanced JSON deserialization exception message
* refactored JsonObject.Tests.ps1
* entitled test cases
* formatting
2016-12-15 00:06:26 -08:00
nmbradford 25005a0ba0 Fix WebRequest failure to handle missing ContentType in response header (#2666)
If a response to invoke-webrequest does not set the content type in the
response header, an object not set exception is thrown in
WebResponseHelper.CoreClr.cs.  Updated to set contenttype = null.
2016-11-14 13:35:07 -08:00
Florian Feldhaus 9ccd778ed6 Enable WebRequestPSCmdlet to not validate HTTPS certificates (#2006)
* Enable WebRequestPSCmdlet to not validate HTTPS certificates

Added switch parameter IgnoreCertificateCheck to WebRequestPSCmdlet to enable Invoke-WebRequest and Invoke-RestMethod to not validate the HTTPS certificate of the server if required.

* Changed IgnoreCertificateCheck parameter name to NoCertificateCheck

Changed the switch parameter IgnoreCertificateCheck to NoCertificateCheck for WebRequestPSCmdlet to enable Invoke-WebRequest and Invoke-RestMethod.

* Changed NoCertificateCheck parameter name to SkipCertificateCheck

Changed the switch parameter NoCertificateCheck to SkipCertificateCheck for WebRequestPSCmdlet to enable Invoke-WebRequest and Invoke-RestMethod.

* Added test for SkipCertificateCheck parameter

Validation of SkipCertificateCheck parameter in Invoke-WebRequest and Invoke-RestMethod. First validating, that exception is thrown for HTTPS URI with expired certificate. Then validating, that no exception is thrown if SkipCertificateCheck parameter is used. HEAD method must be used for Invoke-RestMethod to not return any body. Invoke-RestMethod can't parse the HTML returned when using GET method.

* Updated test for SkipCertificateCheck parameter to use ExecuteWebCommand function
2016-11-03 14:29:17 -07:00
Josh Soref 2badb244de spelling fixes: test 2016-08-25 17:49:32 +00:00
James Truher 9e225ccae2 changes tags for tests
Start using tags CI, Feature, Scenario
2016-07-27 12:06:51 -07:00
Francisco Gamino 42105138a7 Adding WebCmdlets tests 2016-07-24 16:20:46 -07:00