Search the site

Vugen: Capture ALL HTTP Responses

Let's say you want to capture the http response of a page, but it redirects you (code 302). The normal way you might capture the HTTP status code is capturing it in a variable:

HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE) 

This would be put after the page request in the script. However, this will only capture the LAST status code received. If there is a redirection in between, it will not be captured. So how do you get the first one?  Capture the response header using a correlation. Use the web_reg_save_param function with the following arguments:

Use the "ORD=ALL" argument to capture all occurrences.  Use the "Search=Headers" argument to search the response header only.

Here is an example:

web_reg_save_param("response","LB=HTTP/1.1 ", "RB= ", "Search=Headers" ,"ORD=ALL", LAST);

Then just spit out "response" to the output log as a message.

Subscribe to Our Podcasts
Our Clients Include…
  • Deloitte Services
  • Coventry Healthcare
  • CSX
  • Fifth Third Bank
  • HealthStream
  • Kroger
  • Max Technical Training
  • MPS Group
  • Sarasota Memorial Hospital
  • Take Charge America
  • Streamline Health Inc.
Our Contributors
Click Name for Full Profile