File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
src/main/java/org/springframework/data/rest/shell Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -307,9 +307,13 @@ public String execute(final HttpMethod method,
307
307
final boolean follow ,
308
308
final String outputPath ) {
309
309
final StringBuilder buffer = new StringBuilder ();
310
+ MediaType contentType = configCmds .getHeaders ().getContentType ();
311
+ if (contentType == null ) {
312
+ contentType = MediaType .APPLICATION_JSON ;
313
+ }
310
314
311
315
ResponseErrorHandler origErrHandler = restTemplate .getErrorHandler ();
312
- RequestHelper helper = (null == data ? new RequestHelper () : new RequestHelper (data , MediaType . APPLICATION_JSON ));
316
+ RequestHelper helper = (null == data ? new RequestHelper () : new RequestHelper (data , contentType ));
313
317
ResponseEntity <String > response ;
314
318
try {
315
319
restTemplate .setErrorHandler (new ResponseErrorHandler () {
@@ -607,5 +611,4 @@ private class SslAwareClientHttpRequestFactory extends SimpleClientHttpRequestFa
607
611
super .prepareConnection (connection , httpMethod );
608
612
}
609
613
}
610
-
611
614
}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ public Collection<String> getSupportedList() {
26
26
public String format (String nonFormattedString ) {
27
27
try {
28
28
Transformer serializer = SAXTransformerFactory .newInstance ().newTransformer ();
29
- serializer .setOutputProperty (OutputKeys .OMIT_XML_DECLARATION , "true " );
29
+ serializer .setOutputProperty (OutputKeys .OMIT_XML_DECLARATION , "yes " );
30
30
serializer .setOutputProperty (OutputKeys .INDENT , "yes" );
31
31
serializer .setOutputProperty ("{http://xml.apache.org/xslt}indent-amount" , "2" );
32
32
Source xmlSource = new SAXSource (new InputSource (new ByteArrayInputStream (nonFormattedString .getBytes ())));
You can’t perform that action at this time.
0 commit comments