Showing results for 
Search instead for 
Did you mean: 

Traffic Script - Change a POST url?

Occasional Contributor

Traffic Script - Change a POST url?


I am new to Riverbed Traffic Scripts.  What i need to do is change the post URL that someone is trying to POST to.  I am probably not explaining it correctly.

When the customer does a GET from our web server the packet capture shows just the query string:

GET /Test_Page/Testing_Page_ID.aspx?trx_id=DFT12345678901234567890&token=8zxc4v85bnmas3005216

But when i see the POST (they are going to post some XML.  I am seeing the following:


We are then returning a 404 (not that i can see this on the IIS server logs, so i am guessing the STM is returning it, but i might be wrong?

Is there a way using a traffic script to remove the first part of it and just use the query string to fo the POST?

Thanks in advance for your help



Re: Traffic Script - Change a POST url?

Hi Martin,

You might want to take a look at these examples : HowTo: Inspect HTTP request parameters

Specifically these variables :

$rawurl    = http.getRawURL();      # returns '/search?hl=en&q=ZXTM&btnG=Google+Search'

$path        = http.getPath();        # returns '/search'

$querystr = http.getQueryString();  # returns 'hl=en&q=ZXTM&btnG=Google+Search'

Best regards


Occasional Contributor

Re: Traffic Script - Change a POST url?

Hi Bjarke,

Thank you for your response it helped me come up with the following script to fix the problem:



$url = http.getRawURL();

# Rewrite Path to remove the IP Address

if( string.contains( $url , "" ) ||

    string.contains( $url , "" )

) {

   http.setPath( "Test_Page/Testing_Page_ID.aspx" );


Thanks again