HsacExamples.SlimTests.HttpTests.CustomHttpConfig.HttpCompressionViaSetup


Http GET with gzip compression support


Performs HTTP GET with gzip compression support.

script http client setup
enable content compression
configure http test

script http test
get from http://fakerestapi.azurewebsites.net/api/activities/1
show response {"ID":1,"Title":"Activity 1","DueDate":"2020-03-16T09:31:15.854267+00:00","Completed":false}

Note that the Content-Encoding header is automatically removed after the content is decoded, so |show|response header|Content-Encoding| will show null regardless of actual encoding. Tools like Wireshark will allow you to see if the content was really sent gzipped.

Note that 'enable content compression' lasts for the rest of the test run, so we need to reset after test.
This is achieved in this suite's TearDown.

Included page: .HsacExamples.SlimTests.HttpTests.CustomHttpConfig.TearDown (edit)

Since changing HTTP client setting last for the entire run we ensure http test's HTTP client is set back to default after each test.
The original default setting is saved in the SuiteSetUp of this suite.

script http client setup
configure http test with $originalClient