Hi all, How do I use trafficscript to ensure that a post is only sent to the pool if the http header is an XML?
Solved! Go to Solution.
You could use something like this to test whether a POST command is XML, based on the content type:
if( http.getmethod() == "POST" ) { if( http.getheader( "Content-Type" ) != "text/xml" ) { connection.close( "403 XML content only, may be POSTed\r\n" ); } }
Does that work for your application?
You could use something like this to test whether a POST command is XML, based on the content type:
if( http.getmethod() == "POST" ) { if( http.getheader( "Content-Type" ) != "text/xml" ) { connection.close( "403 XML content only, may be POSTed\r\n" ); } }
Does that work for your application?