Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Taurus JSON Body post

I trying to use taurus and test my restapi. My restapi using JSON body in POST requests. So i can't find anywhere how to put json into my POST request.

I tryed like this, but this not work.

execution:
  - concurrency: 25
    throughput: 25
    ramp-up: 1m
    hold-for: 5m
    steps: 3
    scenario: blazemeter-recording

scenarios:
  blazemeter-recording:
    timeout: 5s
    retrieve-resources: false
    store-cache: true
    store-cookie: false
    default-address: https://someurl
    headers:
      User-Agent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36'
      Accept-Language: 'ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4'
      Accept-Encoding: 'gzip, deflate, sdch'
      Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp'
    requests:
      - url: '/api/v8/url/url/url'
        method: POST
        label: '/api/v8/url/url/url'
        headers:
          Content-Type: application/json
        body:
          "{\"applicationId\":1,\"objectId\":196,\"tags\":[{\"tag\":\"#ObjectsFilter:filter:Data#\",\"objectId\":196,\"pagination\":{\"pageSize\":100}}]}"
like image 276
Nuran Zulfigarov Avatar asked Nov 01 '25 14:11

Nuran Zulfigarov


1 Answers

I found solution, i can use "body-file"

      - url: 'url'
        method: POST
        label: 'data label'
        headers:
          Content-Type: application/json
        body-file: /var/tests/json_event_filter.json
like image 84
Nuran Zulfigarov Avatar answered Nov 04 '25 20:11

Nuran Zulfigarov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!