# Cannot read request-\>url() from ESPAsyncWebServer

**URL:** <https://forum.arduino.cc/t/cannot-read-request-url-from-espasyncwebserver/1371652>\
**Category:** Networking, Protocols, and Devices\
**Created:** [April 8, 2025, 2:35pm UTC](https://forum.arduino.cc/t/cannot-read-request-url-from-espasyncwebserver/1371652 "2025-04-08T14:35:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark81](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/mark81/32/1013044_2.png) [@Mark81](https://forum.arduino.cc/u/Mark81)\
**Post date:** [April 8, 2025, 2:35pm UTC](https://forum.arduino.cc/t/cannot-read-request-url-from-espasyncwebserver/1371652/1 "2025-04-08T14:35:01Z")

</div>

Using the 3.7.4 version of [ESPAsyncWebServer](https://github.com/ESP32Async/ESPAsyncWebServer) I get an exception when I try to read the `url()` from a `request` lambda.

Here a complete MRE:

```arduino
#include <WiFi.h>
#include <AsyncTCP.h>
#include <ESPAsyncWebServer.h>

AsyncWebServer server(80);

void setup() {
    Serial.begin(115200);
    delay(1000); 

    WiFi.begin("MySSID", "MyPassword");
    while (WiFi.status() != WL_CONNECTED) {
        delay(1000);
        Serial.println("Connecting to WiFi...");
    }
    Serial.println("Connected to WiFi");

    server.onNotFound([](AsyncWebServerRequest *request) {
        if (request) Serial.println(request->url());
        else Serial.println("not valid");
        request->send(404);
    });

    server.begin();
}

void loop() {
}

```

Here the full debug output:

```arduino
Connecting to WiFi...
Connected to WiFi

Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.

Core 1 register dump:
PC : 0x400f20b4 PS : 0x00060233 A0 : 0x800ea2e2 A1 : 0x3ffd0f30  
A2 : 0x3ffbdeb8 A3 : 0x000b9033 A4 : 0x000b9033 A5 : 0x3ffd0f6c  
A6 : 0x00060220 A7 : 0x00000001 A8 : 0x00000000 A9 : 0x0000002f  
A10 : 0x60000000 A11 : 0x3ff40000 A12 : 0x00060220 A13 : 0x00060223  
A14 : 0x007bdebc A15 : 0x003fffff SAR : 0x00000008 EXCCAUSE: 0x0000001c  
EXCVADDR: 0x000b9033 LBEG : 0x40089aed LEND : 0x40089b0f LCOUNT : 0xffffffff  

Backtrace: 0x400f20b1:0x3ffd0f30 0x400ea2df:0x3ffd0f60 0x400eb1a0:0x3ffd0f90 0x400eb965:0x3ffd0fe0 0x400e82bd:0x3ffd1010 0x400e5b19:0x3ffd1030 0x400e60cd:0x3ffd1050 0x400d27f3:0x3ffd1070 0x400d5ea5:0x3ffd10b0 0x40183697:0x3ffd1100 0x400d5652:0x3ffd1120 0x400e09a3:0x3ffd11b0 0x400d5652:0x3ffd11f0 0x400e2086:0x3ffd1280 0x400e2c7e:0x3ffd12c0 0x400e2dc7:0x3ffd1300 0x400e2fed:0x3ffd1350 0x400d37e4:0x3ffd1370 0x400d3a95:0x3ffd13c0
  #0 0x400f20b1 in uart_hal_write_txfifo at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/hal/uart_hal_iram.c:41
  #1 0x400ea2df in uart_enable_tx_write_fifo at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/driver/uart.c:833
  #2 0x400eb1a0 in uart_tx_all at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/driver/uart.c:1256
  #3 0x400eb965 in uart_tx_all at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/driver/uart.c:1225
      (inlined by) uart_write_bytes at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/driver/uart.c:1284
  #4 0x400e82bd in uartWriteBuf at /home/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-uart.c:682
  #5 0x400e5b19 in HardwareSerial::write(unsigned char const*, unsigned int) at /home/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/HardwareSerial.cpp:480
  #6 0x400e60cd in Print::write(char const*, unsigned int) at /home/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/Print.h:72
      (inlined by) Print::print(String const&) at /home/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/Print.cpp:79
      (inlined by) Print::println(String const&) at /home/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/Print.cpp:176
  #7 0x400d27f3 in std::_Function_handler<void (AsyncWebServerRequest*), setup()::{lambda(AsyncWebServerRequest*)#1}>::_M_invoke(std::_Any_data const&, AsyncWebServerRequest*&&) at src/main.cpp:22
      (inlined by) _M_invoke at /home/user/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch5/xtensa-esp32-elf/include/c++/8.4.0/bits/std_function.h:297
  #8 0x400d5ea5 in std::function<void (AsyncWebServerRequest*)>::operator()(AsyncWebServerRequest*) const at /home/user/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch5/xtensa-esp32-elf/include/c++/8.4.0/bits/std_function.h:687
      (inlined by) AsyncCallbackWebHandler::handleRequest(AsyncWebServerRequest*) at .pio/libdeps/Aphrodite/ESPAsyncWebServer/src/WebHandlers.cpp:311
  #9 0x40183697 in std::_Function_handler<void (), AsyncWebServerRequest::_runMiddlewareChain()::{lambda()#2}::operator()() const::{lambda()#1}>::_M_invoke(std::_Any_data const&) at WebRequest.cpp:?
  #10 0x400d5652 in std::function<void ()>::operator()() const at /home/user/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch5/xtensa-esp32-elf/include/c++/8.4.0/bits/std_function.h:687
      (inlined by) AsyncMiddlewareChain::_runChain(AsyncWebServerRequest*, std::function<void ()>) at .pio/libdeps/Aphrodite/ESPAsyncWebServer/src/Middleware.cpp:56
  #11 0x400e09a3 in std::_Function_handler<void (), AsyncWebServerRequest::_runMiddlewareChain()::{lambda()#2}>::_M_invoke(std::_Any_data const&) at .pio/libdeps/Aphrodite/ESPAsyncWebServer/src/WebRequest.cpp:700
      (inlined by) _M_invoke at /home/user/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch5/xtensa-esp32-elf/include/c++/8.4.0/bits/std_function.h:297
  #12 0x400d5652 in std::function<void ()>::operator()() const at /home/user/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch5/xtensa-esp32-elf/include/c++/8.4.0/bits/std_function.h:687
      (inlined by) AsyncMiddlewareChain::_runChain(AsyncWebServerRequest*, std::function<void ()>) at .pio/libdeps/Aphrodite/ESPAsyncWebServer/src/Middleware.cpp:56
  #13 0x400e2086 in AsyncWebServerRequest::_runMiddlewareChain() at .pio/libdeps/Aphrodite/ESPAsyncWebServer/src/WebRequest.cpp:698 (discriminator 4)
  #14 0x400e2c7e in AsyncWebServerRequest::_parseLine() at .pio/libdeps/Aphrodite/ESPAsyncWebServer/src/WebRequest.cpp:683
  #15 0x400e2dc7 in AsyncWebServerRequest::_onData(void*, unsigned int) at .pio/libdeps/Aphrodite/ESPAsyncWebServer/src/WebRequest.cpp:158
  #16 0x400e2fed in std::_Function_handler<void (void*, AsyncClient*, void*, unsigned int), AsyncWebServerRequest::AsyncWebServerRequest(AsyncWebServer*, AsyncClient*)::{lambda(void*, AsyncClient*, void*, unsigned int)#5}>::_M_invoke(std::_Any_data const&, void*&&, AsyncClient*&&, std::_Any_data const&, unsigned int&&) at .pio/libdeps/Aphrodite/ESPAsyncWebServer/src/WebRequest.cpp:70
      (inlined by) _M_invoke at /home/user/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch5/xtensa-esp32-elf/include/c++/8.4.0/bits/std_function.h:297
  #17 0x400d37e4 in std::function<void (void*, AsyncClient*, void*, unsigned int)>::operator()(void*, AsyncClient*, void*, unsigned int) const at /home/user/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch5/xtensa-esp32-elf/include/c++/8.4.0/bits/std_function.h:687
      (inlined by) AsyncClient::_recv(tcp_pcb*, pbuf*, signed char) at .pio/libdeps/Aphrodite/AsyncTCP/src/AsyncTCP.cpp:1123
  #18 0x400d3a95 in AsyncClient::_s_recv(void*, tcp_pcb*, pbuf*, signed char) at .pio/libdeps/Aphrodite/AsyncTCP/src/AsyncTCP.cpp:1488
      (inlined by) _handle_async_event at .pio/libdeps/Aphrodite/AsyncTCP/src/AsyncTCP.cpp:257
      (inlined by) _async_service_task at .pio/libdeps/Aphrodite/AsyncTCP/src/AsyncTCP.cpp:292

```

I also tried to:

- print `request->url().c_str()`
- store the `request->url()` in a String variable before printing it

in any case the exception is raised at the line that contains `request->url()`.  
What am I missing?

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [October 5, 2025, 2:35pm UTC](https://forum.arduino.cc/t/cannot-read-request-url-from-espasyncwebserver/1371652/2 "2025-10-05T14:35:13Z")

</div>

Closed on October 5, 2025, 2:35pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
