Tidy not mandatory for example REST scripts.
* Fixed doc too. FEA: ItEr74S04BugFixing
This commit is contained in:
parent
a50bd81335
commit
b19cc48936
5 changed files with 28 additions and 10 deletions
|
|
@ -2387,9 +2387,9 @@ created in project repository inside ``scripts/rest-clients`` directory.
|
|||
|
||||
.. NOTE::
|
||||
|
||||
Currently these scripts depends on Tidy to be installed in your
|
||||
system. You could install them in a Debian based distribution with the
|
||||
following command as root::
|
||||
Currently these scripts recommends Tidy to be installed in your system
|
||||
for a better output. You could install them in a Debian based distribution
|
||||
with the following command as root::
|
||||
|
||||
apt-get install tidy
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
+ Check you have "tidy" available from the command line.
|
||||
+ It's recommended to have "tidy" available in your system.
|
||||
|
||||
+ chmod u+x *.sh
|
||||
|
||||
|
|
|
|||
|
|
@ -61,5 +61,11 @@ else
|
|||
serviceURIWithParams="$baseServiceURL/resourceshours/$resourceCode/$startDate/$endDate/"
|
||||
fi
|
||||
|
||||
curl -sv -X GET $certificate --header "Authorization: Basic $authorization" \
|
||||
$serviceURIWithParams | tidy -xml -i -q -utf8
|
||||
result=`curl -sv -X GET $certificate --header "Authorization: Basic $authorization" \
|
||||
$serviceURIWithParams`
|
||||
|
||||
if hash tidy &> /dev/null; then
|
||||
echo $result | tidy -xml -i -q -utf8
|
||||
else
|
||||
echo $result
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -20,5 +20,11 @@ fi
|
|||
|
||||
authorization=`echo -n "$loginName:$password" | base64`
|
||||
|
||||
curl -sv -X GET $certificate --header "Authorization: Basic $authorization" \
|
||||
$baseServiceURL/$1 | tidy -xml -i -q -utf8
|
||||
result=`curl -sv -X GET $certificate --header "Authorization: Basic $authorization" \
|
||||
$baseServiceURL/$1`
|
||||
|
||||
if hash tidy &> /dev/null; then
|
||||
echo $result | tidy -xml -i -q -utf8
|
||||
else
|
||||
echo $result
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -27,7 +27,13 @@ fi
|
|||
|
||||
authorization=`echo -n "$loginName:$password" | base64`
|
||||
|
||||
curl -sv -X POST $certificate -d @$file \
|
||||
result=`curl -sv -X POST $certificate -d @$file \
|
||||
--header "Content-type: application/xml" \
|
||||
--header "Authorization: Basic $authorization" \
|
||||
$baseServiceURL/$1 | tidy -xml -i -q -utf8
|
||||
$baseServiceURL/$1`
|
||||
|
||||
if hash tidy &> /dev/null; then
|
||||
echo $result | tidy -xml -i -q -utf8
|
||||
else
|
||||
echo $result
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue