I am send request with postman but it while debugging i am not getting postman requested data

from flask import Flask, render_template, request
import requests, json, urllib.request
import random
import string
app = Flask(__name__)

@app.route('/') 
def student():
   return render_template('form.html')

@app.route('/signup',methods = ['POST', 'GET'])
def result():
   url = "http://114.12.109.187/sign-up?source=114.12.109.187"
   if request.method == 'POST':
      email = request.form['email']
      company = request.form['company']  
      url= request.form['url']
      json_data = { "email":email, "company": company, "spec": "spec"}
      headers = {'Content-type':'application/json', 'Accept':'application/json'}
      response = requests.post(url, json=json_data, headers=headers)
      return response.json()
      print(response.json())

enter image description here I am calling a signup API while requesting with postman I am not able to get the which I have send from postman below is the screenshot which I have send the data from postman

and Above is the python script when debug the email company and URL error is showing that email is not defined could you please help me to get that



Read more here: https://stackoverflow.com/questions/65701867/i-am-send-request-with-postman-but-it-while-debugging-i-am-not-getting-postman-r

Content Attribution

This content was originally published by ImranShaik at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: