This topic is locked

rest api connection -> insert operation

11/18/2020 4:25:17 AM
PHPRunner General questions
C
chanpeter88 author

rest api connection -> create rest api view -> INSERT -> REQUEST BODY

  • need to add ip address like below. how to create name/value pair in request body?
    curl -X POST "https://a.com/add"; \

    -H "X-Auth-Email: a@a.com" \

    -H "X-Auth-Key: 123456" \

    -H "Content-Type: application/json" \

    -d '[{"ip":"10.0.0.2","comment":"Private IP address"}]'

Sergey Kornilov admin 11/19/2020

If you specify POST request for the INSERT operation and also specify Content-Type: application/json then data will be sent in JSON format.