The Pycharm Test RESTful WEB Service tool provides a RESTful interface testing interface, as shown in the following illustration, which provides HTTP methods such as GET, post,put, and the request child interface Headers,parameters, Body and so on, the Response child interface is used to display the return value, Response headers is used to display the returned message header.
Enter: tools-> Test RESTful Web Service
We use the following flask code to briefly introduce the RESTful interface Test interface:
main.py
Flask, request
app = Flask (__name__)
@app. Route ('/hello ')
Index ():
data = Request.args.get (' Data ')
' Hello World: ' + data
__name__ = ' __main__ ':
app.run ()
Test steps:
1. Run MAIN.Y
2. According to the above image input Host/port,path,parameters
3. Click on the small triangle on the left to start the test.
4. View the response and Response headers interface (see figure below)