A simple CURL tester

Report a typo

Write a simple web application that will send a response with JSON and the text Wow! This is GET! and a response with JSON and the text Oomph! Die Leiter, it's POST! if a POST request has been sent.

Tip: Use a dictionary with the message key and a text value that fits the exact method as an argument to the make_response function

Sample Input 1:

GET

Sample Output 1:

ok
Write a program in Python 3
from flask import Flask, make_response, request


app = Flask('main')

@app.route('/')
def view_func():
if request.method == 'METHOD':
#your code here
elif request.method == 'METHOD':
#your code here
___

Create a free account to access the full topic