title: POST request using Python flask - postman
body: <p>My code is as below</p>
  <pre><code># Cafe TABLE Configuration
  class Cafe(db.Model):
      id = db.Column(db.Integer, primary_key=True)
      name = db.Column(db.String(250), unique=True, nullable=False)
      map_url = db.Column(db.String(500), nullable=False)
      img_url = db.Column(db.String(500), nullable=False)
      location = db.Column(db.String(250), nullable=False)
      seats = db.Column(db.String(250), nullable=False)
      has_toilet = db.Column(db.Boolean, nullable=False)
      has_wifi = db.Column(db.Boolean, nullable=False)
      has_sockets = db.Column(db.Boolean, nullable=False)
      can_take_calls = db.Column(db.Boolean, nullable=False)
      coffee_price = db.Column(db.String(250), nullable=True)
  </code></pre>
  <h1>HTTP POST - Create Record</h1>
  <pre><code>app.route('/add_cafe', methods=['POST', 'GET'])
  
  
  def add_cafe():
      new_data = Cafe(name=request.form.get(&quot;name&quot;),
                      map_url=request.form.get(&quot;map_url&quot;),
                      img_url=request.form.get(&quot;img_url&quot;),
                      location=request.form.get(&quot;location&quot;),
                      has_sockets=bool(int(request.form.get(&quot;has_sockets&quot;))),
                      has_toilet=bool(int(request.form.get(&quot;has_toilet&quot;))),
                      has_wifi=bool(int(request.form.get(&quot;has_wifi&quot;))),
                      can_take_calls=bool(int(request.form.get(&quot;can_take_calls&quot;))),
                      seats=request.form.get(&quot;seats&quot;),
                      coffee_price=request.form.get(&quot;coffee_price&quot;)),
  
      new_cafe_json = jsonify(cafe=new_data)
      db.session.add(new_cafe_json)
      db.session.commit()
      return jsonify(result={&quot;Success&quot;: &quot;Added successfully&quot;})
  </code></pre>
  <p><a href="https://i.stack.imgur.com/HWKFR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HWKFR.png" alt="Screen shot of postman request and response" /></a></p>
  <p>I am getting 404 error - not found. Other requests are working fine. Any help. I am a beginner.</p>