title: Python Flask-restful multiple api endpoints
body: <p>How to check what route has been used?</p>
  
  <p>Using @api with Flask-restful and Python at the moment I'm not doing it in a  clean way by checking <code>api.endpoint</code> value.</p>
  
  <p>How do I do it correctly? </p>
  
  <pre><code>@api.route('/form', endpoint='form')
  @api.route('/data', endpoint='data')
  class Foobar(Resource):
      def post(self):
          if api.endpoint == 'api.form':
              print('form')
          elif api.endpoint == 'api.data':
              print('data')
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>Should I split it into two classes? </p>