Compare http_req_failed and check

before version 0.31, I used check to verify if request was successful or not based on the status code. How is check different from http_req_failed in this regard?

http_req_failed is the same idea, just more flexible. For example, your API might return several different status codes that are OK, e.g. 200 OK and 201 Created and maybe some redirects. It would be more easy to encompass them with a single threshold using http_req_failed / expected_response