Hi richie
Thanks for your time!... once again 🙂
A little bit of nerdy explanation in what I do know in coding (not much but I handle it 🙂 .... At least I'm trying 😄 )
For starters, this is not a simple REST Request, this is an HTTP request. (I've should have mentioned that maybe...?) This said, the response that I'm receiving is an HTML page that can be read as an XML. So your proposition
"tried using an 'Accept' header (with value 'application/json')" is not do-able for me. (I've tried but this gives me a 'bad message' error 😉 )
" as your NationalId values in your XML are contained within an array, whereas the NationalId values in the json are just multiple separate name/value pairs. "
not true in this case, this is a json array 😉 watch the " {[ ]} ". Json always starts with " { } " but it can go on with lists or it can contain arrays " [ ] ". And as the answer is giving me [nr1, nr2, nr3, etc..] it means that the response is an array. With jsonSlurper you can read the values in that array, so no problems there, but with XmlSlurper apparently it also gives the quotes. Like said in the description, I've tried to omit the quotes with regex but it doesn't work. I think because this code is in an assertion script code....? don't know.
To the groovy guru's: any idea? preferred code wise as I already have code to fetch other ID's in this response.
nmrao HimanshuTayal
Thanks in advance,
AboveAndBeyond