title: Python Flask API : The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again
body: <pre><code>from flask import Flask, jsonify, request
  
  app = Flask(__name__)
  tasks = [
      {
          &quot;id&quot;:1,
          &quot;title&quot;:&quot;You buy groceries&quot;,
          &quot;description&quot;:&quot;Milk, Cheeses, Pizza&quot;,
          &quot;done&quot;:False,
      },
      {
          &quot;id&quot;:2,
          &quot;title&quot;:&quot;Learn Python&quot;,
          &quot;description&quot;:&quot;The most important language in the world&quot;,
          &quot;done&quot;:False,
      },
  ]
  
  @app.route('/add-data', methods = ['POST'])
  
  def add_data():
      if not request.json:
          return jsonify({
              &quot;status&quot;:&quot;error&quot;,
              &quot;message&quot;:&quot;Please provide the data&quot;
          },400)
      task = {        
          &quot;id&quot;:tasks[-1][id]+1,
          &quot;title&quot;:request.json[&quot;title&quot;],
          &quot;description&quot;:request.json.get(&quot;description&quot;,&quot;&quot;),
          &quot;done&quot;:False,
      }
      tasks.append(task)
      return jsonify({
          &quot;status&quot;:&quot;success&quot;,
          &quot;message&quot;:&quot;Task added successfully!&quot;
      })
  
  @app.route(&quot;/get-data&quot;)
  
  def get_task():
      return jsonify({
          &quot;data&quot;:tasks
      })
  
  if __name__ == &quot;__main__&quot;:
      app.run(debug=True)
  </code></pre>
  <p>I am just a beginner in this api creating with python and I was trying to create an api to get the data and to post data.</p>
  <p>But when I run the code, it gives me the error :</p>
  <p><a href="https://i.stack.imgur.com/HtiVG.png" rel="nofollow noreferrer">The screenshot of the error</a></p>
  <p>Let me know if there is some error in the code or problem of the virtual environment. Would be very much grateful if the solution is also given.</p>