HomeSUPPORT QUESTIONS

Need help with StresStimulus? Start here.

Response Extractor: Extracting the entire response body Messages in this topic - RSS

ter
ter
Posts: 12


8/26/2014
ter
ter
Posts: 12
I am trying to extract the entire response body as a variable.
For example, let's say that the response looks like the following:
_______________________________
HTTP/1.1 201 Created
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Location: http://...
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Mon, 25 Aug 2014 23:46:14 GMT
Content-Length: 4167
{"SomeJSONData": ... }
____________________________I tried using "Text Delimited", but there is no "Text After" I can set. "Header" cannot be used either. I did manage to use Regular Expression as follows:
[\n\r].*Content-Length: \d+\s*([^\n\r]*)
basically, everything after the "Content-Length" end of line.
Is there anything else I can use to extract the entire response? Is there a "Response" option like there is a "Header" option?
Thanks,

0 link
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583


8/26/2014
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583
Ter,
You are right, use a Regular Expression. In HTTP the Body is separated from the Headers by 2 new line characters. So this Regular Expression will work faster:
\n\r\n\r(.*)

-Vadim
0 link
ter
ter
Posts: 12


8/27/2014
ter
ter
Posts: 12
Vadim:
Thank you for the suggestion.
0 link
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583


8/27/2014
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583
You're welcome, Ter.
0 link






Copyright © 2024 Stimulus Technology