Forum Discussion

MSZ_221163's avatar
MSZ_221163
Icon for Nimbostratus rankNimbostratus
Sep 28, 2016

Blocked Response in JSON Fformat

Hi,

 

The ASM Blocked response page is in HTML format which contains the Support ID. Even we enabled the AJAX response it is also in simple HTML format.

 

I need the Blocked response from ASM in JSON format.

 

Best Wishes,

 

2 Replies

  • Hi MSZ,

    if you need the blocking response from the ASM in JSON format, just modify the default response message. You can just send JSON instead on HTML content.

    I.e.

    [{"status":"error","data":{"message":"This request was rejected due to a violation. Please contact webmaster@example.com, and provide this reference ID:  <%TS.request.ID()%>"}}]
    

    Please make sure, that you change the Content-Type Header as well.

    If you cannot set the JSON response for the whole Security Policy, but for single URIs or if the request is of type "application/json", you need to create an iRule, which sends the response instead of the policy itself.

    Hope this helps.

    Greets, svs