2

I'm trying to update defects in quality centre using their REST API from a curl-based script.

So far, I've managed to authenticate, store the cookie, and retrieve a defect's data from QC.

My problems start when I try to send data to update a defect, I always seem to get a 'method unsupported' exception.

My curl command is:

curl -b cookie.txt –T @xml.txt -H "Content-Type: application/xml; Accept: application/xml" http://qcserver/qcbin/rest/domains/DK/projects/R2/defects/74

I'm sending the following xml, just trying to update a standard field at the moment.

<xml version="1.0" encoding="UTF-8" standalone="yes" ?> <Entity Type="defect"><Fields><Field Name="owner"><Value>me</Value></Field></Fields></Entity>

The QC documentation says to use a 'PUT' command, so I've tried sending the XML using the -T curl option but that does not work, so I assume it still needs to be POSTed. Any suggestions gratefully received.

  • I'm more interested about the part which talks about authenticate, store the cookie, and retrieve a defect's data from QC. Can you please explain how did you accomplish this? – user17187 Mar 11 '16 at 0:55
  • 5 years on? Not really. You need the QC SDK though, the docs were useful IIRC. – gbjbaanb Mar 11 '16 at 22:17
1

The curl man page says you need to use "-X PUT" to issue a PUT request.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.