Permalink
Browse files

should be setting the content type for XML like for JSON

  • Loading branch information...
Burt Beckwith
Burt Beckwith committed Dec 5, 2012
1 parent ac1c6b4 commit b4c6d529344d172ea1a0f8dc43d525ca88136225
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/groovy/grails/plugins/rest/client/RequestCustomizer.groovy
@@ -85,12 +85,18 @@ class RequestCustomizer {
StringWriter sw = new StringWriter()
markup.writeTo(sw)
body = sw.toString()
+ if (!headers.contentType) {
+ contentType "application/xml"
+ }
return this
}
RequestCustomizer xml(object) {
def xml = object as XML
body = xml.toString()
+ if (!headers.contentType) {
+ contentType "application/xml"
+ }
return this
}
@@ -116,7 +122,7 @@ class RequestCustomizer {
}
HttpEntity createEntity() {
- return mvm ? new HttpEntity(mvm, headers) : new HttpEntity(body, headers)
+ return mvm ? new HttpEntity(mvm, headers) : new HttpEntity(body, headers)
}
void setProperty(String name, value) {

0 comments on commit b4c6d52

Please sign in to comment.