Showing results for 
Search instead for 
Did you mean: 

Binary in request - vTM

Occasional Contributor

Binary in request - vTM

Hi all,
How can we identify a http request by the POST method that comes as binary.

Thanks for listening.

Tags (1)
New Contributor

Re: Binary in request - vTM

You can use something like:


if( http.getMethod() == "POST" ) {
    # handle POST request ...


to test for a POST.


You could also and (&&) this with http.getResponseHeader( "Content-Type" ) to match on POSTs for specific Content-Type(s).


$body = http.getBody() can be used to get a copy of the POST data.


http.getFormParams() returns a hash mapping the names of all the form parameters present in the URL query string and, if the request is a POST, in the POST body data to their values. If the same parameter appears multiple times in the request then it will be mapped to an array of values in the hash that is returned by this function.


You might also want to look at the following TrafficScript functions:


  • http.getFormParam( Parameter, [Separator] )
  • http.listFormParamNames()
  • http.doesFormParamExist