The way that HTTP collector, exporter and header objects handle newlines in data depends on the data type.
String, XML and HTML
HTTP objects retain all newline characters in HTTP and XML data. To strip the newlines, add the following expression to the attribute expressions that use the data from the HTTP object
.replaceAll(in.value, "[\r\n]", ""
XML
As PhixFlow cannot include newlines in an attribute value, it automatically replaces newlines in JSON with a space. If you want the data to indicate where the newlines were, in the Statement Expression, specify the escape character \n
.
In the following sample of JSON, the paragraph symbol ↵ indicates a newline character.
{
“line1” : “Single line of text"
“line2” : “Also a single
line of text”
“line3” : “Multiple lines of↵
text split over↵several lines”
}
By default a HTTP collector retrieves...
Not sure how to deal with this for Headers and Exporters....
{“line1” : “Single line of text" “line2” : “Also a single line of text”, “line3” : “Multiple lines of text split over several lines” }
in the Statement Expression, specify ??? to return a string with the newline indicated by /n.
{“line1” : “Single line of text" “line2” : “Also a single line of text”, “line3” : “Multiple lines of/ntext split over/nseveral lines” }