Search⌘ K

Interactive Testing: Introduction

Explore interactive testing techniques in Flask by using HTTPie to send requests and pytest for Python test creation. Understand how to handle JSON payloads and HTTP headers effectively to test server-side APIs.

Introduction

In this chapter, we will review interactive testing with HTTPie and introduce pytest, which is a great way to create Python tests. We’ll also address the challenges that come up with testing a Flask application.

How to use HTTPie

In Server-Side API Creation with Flask , we look at how to use HTTPie to interact with our web API.

$ http POST 0.0.0.0:3000/my-api number=1729 description="First taxi-cab number"
...