Skip to content

Payload

Send various types of content as payload

HTTP services with POST endpoints may accept payloads. Send various types of content as payload during the load test.


Before you begin
  1. Install Iter8.
  2. Complete the quick start tutorial.

1. Run sample app

Run the httpbin sample app from a separate terminal. We will load test this app in this example.

docker run -p 80:80 kennethreitz/httpbin
You may also use Podman or other alternatives to Docker in the above command.

2. Download experiment chart

iter8 hub -e load-test
cd load-test

3. Run experiment

We will load test and validate the HTTP service whose URL is http://127.0.0.1/post.

Iter8 enables you to send any type of content as payload during the load test, either by specifying the payload as a string (payloadStr), or by specifying a URL for Iter8 to fetch the payload from (payloadURL).

Payload examples

Supply a string as payload. This sets the content type to application/octet-stream.

iter8 run --set url=http://127.0.0.1/post \
          --set payloadStr="abc123" \
          --set SLOs.error-rate=0 \
          --set SLOs.mean-latency=50 \
          --set SLOs.p90=100 \
          --set SLOs.p'97\.5'=200

Supply a string as payload and explicitly set the content type to text/plain.

iter8 run --set url=http://127.0.0.1/post \
          --set payloadStr="abc123" \
          --set contentType="text/plain" \
          --set SLOs.error-rate=0 \
          --set SLOs.mean-latency=50 \
          --set SLOs.p90=100 \
          --set SLOs.p'97\.5'=200

Fetch JSON content from a payload URL. Use this JSON as payload and explicitly set the content type to application/json.

iter8 run --set url=http://127.0.0.1/post \
          --set payloadURL=https://json-generator.com/ \
          --set contentType="application/json" \
          --set SLOs.error-rate=0 \
          --set SLOs.mean-latency=50 \
          --set SLOs.p90=100 \
          --set SLOs.p'97\.5'=200

Fetch jpeg image from a payload URL. Use this image as payload and explicitly set the content type to image/jpeg.

iter8 run --set url=http://127.0.0.1/post \
          --set payloadURL=https://cdn.pixabay.com/photo/2021/09/08/17/58/poppy-6607526_1280.jpg \
          --set contentType="image/jpeg" \
          --set SLOs.error-rate=0 \
          --set SLOs.mean-latency=50 \
          --set SLOs.p90=100 \
          --set SLOs.p'97\.5'=200


Assert experiment outcomes and view reports as described in the quick start tutorial.

Back to top