It's all about the answers!

Ask a question

how do I use Curl to work with the RQM API?

Matthieu Leroux (6571612) | asked Apr 17 '20, 5:49 a.m.

I want to use Curl as a tool to interact with the RQM/ETM API. How do I do that?

One answer

permanent link
Matthieu Leroux (6571612) | answered Apr 17 '20, 5:50 a.m.
edited Apr 18 '20, 4:18 p.m.

You need to send a post request to qm/j_security_check with your credentials and save the cookies in a cookie jar:

curl -k --location --cookie jar.txt --cookie-jar jar.txt '' --header 'accept: /' --header 'oslc-core-version: 2.0' --header 'Content-Type: application/x-www-form-urlencoded' --header 'Content-Type: application/x-www-form-urlencoded' --data j_username=jazzadmin --data j_password=jazzadmin

using the same cookies, you can then do a get request to the api:
curl -k --cookie jar.txt --location --request GET '' --header 'Accept: application/xml'

you can then use this xml as an example and do a put request to create a new one:

curl -k --cookie jar.txt --location --request PUT '' --header 'content-type:application/xml' --data '<the xml of your test script here>'

if you saved the xml as a file, use --data @myfile.xml

Your answer

Register or to post your answer.