apache / apache/grails-core

Rest Client Builder: 2.2.1 Doesn't send XML but does send JSON

Open
#14,640 0 comments 0 reactions 1 assignee Claimed by @jameskleeh View on GitHub
relates-to: gorm
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

I tried using rest builder as such with success:
def rest = new RestBuilder()
def result = rest.post(url){
contentType "application/json"
json "test"
}

However when I change it to XML as below it doesn't send the XML payload and doesn't get picked up on my API:
def rest = new RestBuilder()
def result = rest.post(url){
contentType "application/xml"
xml "test"
}

I checked send xml via curl and it works fine:
curl -i -X POST -H "Content-Type: application/xml" -d 'test' localhost:8090/TestMe/api

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.