Application Framework Reference

App Server Utilities API

is_api()

The is_api() function indicates if the current request was made to the /api endpoint.

Synopsis

results = is_api()

Return Value

Boolean

Current request made to /api endpoint flag:

True = Current request was made to the /api endpoint .

False = Current request was not made to the /api endpoint .

Example

from splunk.appserver.mrsparkle.lib import util
    ... elided ...

def check(fn, self, *a, **kw):
    is_api = util.is_api()
    if (is_api):
        ... elided ...
    else
        ... elided ...