Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
zaccak opened this issue Oct 3, 2015 · 0 comments
Open

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

zaccak opened this issue Oct 3, 2015 · 0 comments
Assignees

Comments

@zaccak
Copy link

zaccak commented Oct 3, 2015

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

@jameskleeh jameskleeh self-assigned this Feb 20, 2017
jamesfredley referenced this issue in apache/grails-data-mapping Mar 8, 2025
jamesfredley referenced this issue in apache/grails-data-mapping Mar 13, 2025
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@jdaugherty jdaugherty transferred this issue from apache/grails-data-mapping Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants