Hi
Can you provide more information on the functionality you are trying to implement?
You don't have to match on the contents of the request/response body. You can retrieve any of the information associated with your ProxyRequestResponse item.
I've included an example that matches against a request header.
import burp.api.montoya.BurpExtension;
import burp.api.montoya.MontoyaApi;
import burp.api.montoya.http.message.HttpHeader;
import burp.api.montoya.proxy.ProxyHistoryFilter;
import burp.api.montoya.proxy.ProxyHttpRequestResponse;
import java.util.List;
public class ProxyHistoryFilterExtension implements BurpExtension
{
@Override
public void initialize(MontoyaApi api)
{
api.extension().setName("Test proxy history filter");
ProxyHistoryFilter phf = requestResponse -> requestResponse.finalRequest().headers().contains(HttpHeader.httpHeader("Host", "portswigger-labs.net"));
List<ProxyHttpRequestResponse> matchedItems = api.proxy().history(phf);
matchedItems.forEach(i -> api.logging().logToOutput(i.finalRequest().url()));
}
}