That’s a good start. You could take the second example on the HTTP::collect wiki page (Click here and add a check to see that the response content type contains “text” (or other relevant content-types for you):
Just for people that would need that in the future, I used HTTP_RESPONSE_DATA instead of HTTP_REQUEST_DATA For the testing on the content, I used if {[HTTP::header “Content-Type”] contains “text” && [HTTP::header exists “Content-Length”] && [HTTP::header “Content-Length”] <= 1048576}{