Quantcast
Channel: Silk Performer
Viewing all articles
Browse latest Browse all 4084

Wiki Page: How can I Parse and reuse a HTTP Response Header data in my BDF script?

$
0
0
A HTTP Server Response Header can be easily viewed and parsed from the Truelog Explorer; via the "in-hdr" tab for any corresponding API call. To parse a HTTP Header from the "In-Hdr", please do the following: Highlight the HTTP response Header which you wish to parse. Right Click and Select "Parse Selected Text into a Variable". In the "Insert Parsing Function" change the variable name (optional) and Click "OK". It is also possible to manually parse and reuse header response data in your bdf script, if you prefer to work this way, it can be achieved as follows: Use the "WebParseResponseHeader" function to retrieve all the server"s response headers and save this in a String variable. Use "StrSearchDelimited" function to search this string for the specific value that you need and save to a new String variable, so that value could be printed or reused. For example: The following scenario demonstrates how to parse the entire HTTP response header and then use the function "StrSearchDelimited" to capture the Session id (JSESSIONID). transaction TMain var sHeaders, sSession :string; begin SetEncoding("UTF-8"); WebParseResponseHeader(sHeaders); WebPageUrl(" http://myWebPage /", "Unnamed page"); StrSearchDelimited(sSession, STRING_COMPLETE, sHeaders, "JSESSIONID=", 1, ";", 1, 0); Print(sSession); end TMain;

Viewing all articles
Browse latest Browse all 4084

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>