So I am getting an error in my flask app which says:
File app.py, line 13
first = request.form.get('first')
IndentationError: expected an indented block
Here is my app.py code
import time
import requests
import requests_cache
from flask import Flask, render_template, request, jsonify
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def home():
if request.method == 'POST':
first = request.form.get('first')
url = "http://myAPIURL.com/ws/spm/search/perfid/{0}".format(first)
response = requests.get(url)
return jsonify(response.json())
return render_template('index.html')
if __name__ == '__main__':
app.run(debug=True)
I have checked the indentations and they seem to be fine to me,
Can someone please point out what I am doing wrong?