title: Proper way to make a call to an Endpoint from the API using Flask
body: <p>I'm trying to build a Flask API and I have one endpoint that is supposed to create a user and another one that is suppose to check if a user is present  in the database:</p>
  
  <pre><code>@API.route('/users/', methods=['POST'])
  def new_user():
      user_json = json.loads(request.get_json())
      first_name = user_json.get('first_name')
      last_name = user_json.get('last_name')
      email = user_json.get('email')
      password = user_json.get('password')
      # Call the other endpoint here
      if response == 400:
          try:
             user = User(first_name=first_name, last_name=last_name, email=email, password=password)
             db.session.add(user)
             db.session.commit()
             return jsonify(user=user.to_json()), 200
         except:
             return jsonify(error=500), 500
      else:
         return jsonify(user=user.to_json()), 409
  
  
  
  @API.route('/users/&lt;string:email&gt;', methods=['GET'])
  def is_present(email):
      user = User.query.filter_by(email=email).first()
      if user:
          print(user)
          return jsonify(user=user.to_json()), 200
      else:
          return jsonify(error=404), 404
  </code></pre>
  
  <p>The problem is I don't know what is the best way to call my <code>is_present</code> in the <code>new_user</code> endpoint. Should I use <code>requests.get</code> ? Or is there a specific other to do so in Flask?</p>