CLI detection in the request class

Just added the method from L3. If there's a better way feel free to edit.