728x90
web/backend
-
inconsistent use of tabs and spaces in indentationweb/backend 2022. 4. 13. 10:44
Flask프레임워크를 사용하여 API 구현하기 위해 app.py에 아래와 같은 코드를 작성했다. @app.route('/tweet', methods=['POST']) def tweet(): payload = request.json user_id = int(payload['id']) tweet = payload['tweet'] if user_id not in app.users: return '사용자가 존재하지 않습니다.', 400 if len(tweet) > 300: return '300자를 초과했습니다', 400 user_id = int(payload['id']) app.tweets.append({ 'user_id' : user_id, 'tweet' : tweet }) 저장하고 API 콜을 했는데 오류가..