4

Is there a way to check if being run in RestResource Context? I have a script that posts messages to an endpoint but we can end up in an infinite loop scenario as they are now posting their comments to us. How can I check for this flag or flag this during runtime?

Ideally something like:

Test.isRunningTest() 

1 Answer 1

10

You can check if you're in a REST call via:

Request.getCurrent().getQuiddity() == Quiddity.REST 

You can read more about the Request object, as well as the possible values for Quiddity.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.