Layer7 API Management

Expand all | Collapse all

How to make sure request.http.query is empty or null.

Jump to Best Answer
  • 1.  How to make sure request.http.query is empty or null.

    Posted 12-03-2018 10:19 AM

    Hello.

    I want to make sure there is no query in a GET request. I tried  to test request.http.queryString  or   request.http.query. Nothing works. I don't understand.

     

    Tried !.

    Tried ^$

    Tried

    Tried is empty

    Tried is not empty

    Tried negation

    Tried null

    Tried [^.]

    Tried regexp

    Tried comparison

     

    I must be missing something extremely obvious for such a simple question. How can I do ? I would need detailed instructions because all my attempts failed. So a simple pointer to the doc will not do.

     

    Or... could I use something else instead of Route via https ? Something letting me to request without routing ?

    Thanks.

    Gilles



  • 2.  Re: How to make sure request.http.query is empty or null.
    Best Answer

    Posted 12-03-2018 12:04 PM
      |   view attached

    Hi Gilles,

     

    See if the attached policy helps your case. It makes use of the variable ${request.url.query}.

     

    Regards,

    Joe



  • 3.  Re: How to make sure request.http.query is empty or null.

    Posted 12-04-2018 05:00 AM

    Thanks.

    That was simple indeed. Lack of habit on my side :
    Comparison > Expression > ${request.http.queryString} > Data Type = Unknown/Other > is empty

    The gotcha for me was "Expression" and ${...}.