ESP8266WebServer how to dump raw request in onNotFound handler

I’ve seen a few threads that mention using server.arg(“plain”) to fetch the raw request. Does that work in the onNotFound handler? I’d like to debug some html that I’ve written, it would help to see what request was actually made. Using the code below, entering the URL “esp8266.local/zzkky” directly into a browser, I was hoping to see “zzkky”. But instead the serial monitor shows:

     unknown request has arg count: 0, first:

And my browser shows:

     Unknown Request
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <WiFiClient.h>


void handleNotFound(void)
  // "plain" arg is raw request
  if (server.hasArg("plain"))
    Serial.println("plain argument was found");
  int numArgs = server.args();
  Serial.print("unknown request has arg count: ");
  Serial.print(", first: ");

  server.send(200, "text/plain", "Unknown Request");


  server.on("/favicon.ico", handleFavoriteIcon);
  server.on("/on", handleOn);
  server.on("/off", handleOff);
  server.on("/", handleRoot);

I’d be OK with dumping every request before letting the server handle it, if that’s easier.

P.S. I tried to post this once before, I apologize if this is a repeat.

args are after ? in url. use server.uri() to get the path

Thanks, perfect.