system
August 9, 2017, 2:01pm
1
Originally posted by rramesh on August 09, 2017
Hi,
I need to enter text comprising of newline characters as a parameter value for a REST request in SOAPUI.
The API accepts this data in UTF 8 format.
How do I actually represent new line characters as part of my test data that would be passed as a value to a parameter for the REST request?
Any help would be greatly appreciated.
Thanks,
Ramesh
system
August 9, 2017, 3:28pm
2
Originally posted by sanj on August 09, 2017
Could you not just send a string and use new liner separators?
system
August 9, 2017, 3:32pm
3
Originally posted by rramesh on August 09, 2017
Passing the character “\n” (for newline) as part of the text for the test data does not work.
So, if I pass the text as, say, -:
Hello \n World
In the response, the text appears the same as -:
Hello \n World
and not as -:
Hello
World
system
August 9, 2017, 3:34pm
4
Originally posted by rramesh on August 09, 2017
I also tried using ASCII characters to represent the newline and also CDATA constructs, but nothing seems to work.
Please help.
system
August 9, 2017, 5:11pm
7
Originally posted by sanj on August 09, 2017
the following has some info on how to encode parameters
https://www.soapui.org/testing-dojo/best-practices/understanding-rest-headers-and-parameters.html
system
August 14, 2017, 5:53am
8
Originally posted by nmrao on August 13, 2017
Are you using windows? See if \r\n helps.
system
August 14, 2017, 2:58pm
10
Originally posted by sanj on August 14, 2017
\r is another way of doing new line I was not going to expect that to work
Try searching online line man I am sure someone must have solution to this one
system
August 15, 2017, 8:03am
11
Originally posted by PaulMS on August 15, 2017
you can use the percent-encoded value for a new line, it’s %0D%0A although %0A(ASCII 10 - line feed) or %0D (ASCII 13 - carriage return) should work alone.
https://stackoverflow.com/questions/10601672/posting-url-with-string-parameter-that-contains-line-breaks-using-java
Also disable URL encoding of the parameter value for the REST resource/method when using custom encoding in this case.
For custom encoding handling when setting a parameter value (the “Disable Encoding” setting)
https://www.soapui.org/rest-testing/rest-resources-and-methods.html