cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Request naming rule Via API

Malaik
DynaMight Advisor
DynaMight Advisor

Hello Community,

 

Im using the request naming rule API to creat a rule: /service/requestNaming

 

The body is like this:

{
"enabled": true,
"namingPattern": "/consumer/app/challenge/brw/[ID_GET]",
"conditions": [
{
"attribute": "WEBREQUEST_URL_PATH",
"comparisonInfo": {
"type": "STRING",
"comparison": "BEGINS_WITH",
"value": "/consumer/app/challenge/brw/",
"negate": false,
"caseSensitive": false
}
},
{
"attribute": "HTTP_REQUEST_METHOD",
"comparisonInfo": {
"type": "STRING",
"comparison": "EQUALS",
"value": "GET",
"negate": false,
"caseSensitive": false
}
}

]
}

 

Im getting the bellow error:

{
  "error": {
    "code": 400,
    "message": "Constraints violated.",
    "constraintViolations": [
      {
        "path": "conditions[1].attribute",
        "message": "Condition invalid combination of type, attribute and matcher",
        "parameterLocation": "PAYLOAD_BODY",
        "location": null
      }
    ]
  }
}

 

If someone can help to fixe, I think is going wrong with HTTP_REQUEST_METHOD.

 

Thanks guys.

Sharing Knowledge
2 REPLIES 2

benjamin_mullan
Participant

@Malaik 

The type in the http method clause need to be like so

 

        {
            "attribute": "HTTP_REQUEST_METHOD",
            "comparisonInfo": {
                "type": "HTTP_METHOD",
                "comparison": "EQUALS",
                "value": "GET",
                "negate": false,
                "caseSensitive": false
            }
        }
 
benjamin_mullan_0-1653970718308.png

 

Thanks,

 

Working fine.

Sharing Knowledge