cancel
Showing results for 
Search instead for 
Did you mean: 

Check XML post

SOLVED
Highlighted
Occasional Contributor

Check XML post

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?

Tags (1)
1 REPLY
Contributor

Re: Check XML post

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?