Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

crucible restapi xml parsing fail

Hi I am trying to send a file through restapi which it has special characters (I am using git , I commiited the file and tried to send through restapi), I am using below rest call, but its not anchoring or not generating the review link if the file contains any special characters,

Please let me know hpw to fix this issue

$headers = {"Accept" =>'application/xml', "Content-Type" => 'application/xml', "Authorization" =>'Basic '};
my $responseContent = $client->POST('/rest-service/reviews-v1/?FEAUTH='.$token, $file, $headers);



3 answers

1 accepted

0 votes
Answer accepted

its working now, I've added ![CDATA , its working now, thanks

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
patchdiff here..

As you send the patch in XML format, some special characters must be encoded.
One page where these are described is

If you are using an "&" (ampersand) in your patch, then you need to replace it with "&amp;" if you want to send it as XML.

I am doing diff of my file which it contains special characters, If I am parsing this text into restapi format , it is not working, it doesn't accept the special characters.


DIFF IS diff --git x.txt x.txt
index dec2cbe..d0c7fbe 100644
--- x.txt
+++ x.txt
@@ -1,2 +1,4 @@
diff --git y.txt y.txt
index 8164a18..a58ee72 100644
--- y.txt
+++ y.txt
@@ -1,2 +1,3 @@

I used this restapi call


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence

An update on Confluence Cloud customer feedback – June 2022

Hi everyone, We’re always looking at how to improve Confluence and customer feedback plays an important role in making sure we're investing in the areas that will bring the most value to the most c...

150 views 1 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you