Open MicDG opened 1 month ago
Sorry, just saw this can be used:
String filename = "/path/to/file";
PsychicFileResponse response(request, LittleFS, filename);
return response.send();
However, maybe this could be added in the ReadMe notes just for clarity.
After IDF 5.3 there will be HTTP_ANY
support
Actually in psychic 2.0 we add HTTP_ANY support, and with 5.3 it's much cleaner internally. :)
On Wed, Oct 30, 2024, 04:32 HITEC @.***> wrote:
After IDF 5.3 there will be HTTP_ANY support
— Reply to this email directly, view it on GitHub https://github.com/hoeken/PsychicHttp/issues/195#issuecomment-2446325753, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABEHSQIWHHFLCX3VYBKC6TZ6CRTBAVCNFSM6AAAAABQOPO2VGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBWGMZDKNZVGM . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Actually in psychic 2.0 we add HTTP_ANY support, and with 5.3 it's much cleaner internally. :) … On Wed, Oct 30, 2024, 04:32 HITEC @.> wrote: After IDF 5.3 there will be HTTP_ANY support — Reply to this email directly, view it on GitHub <#195 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABEHSQIWHHFLCX3VYBKC6TZ6CRTBAVCNFSM6AAAAABQOPO2VGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBWGMZDKNZVGM . You are receiving this because you are subscribed to this thread.Message ID: @.>
Does that mean that the v2 is already using your planned approach with HTTP_ANY
and the library's own list of handlers?
@hitecSmartHome yes!
Wow. I must try it
Hello, doing something like this:
causes the server to return an error like "httpd_uri: Method '1' not allowed for URI" when a GET request is made. However doing this works:
I guess this is due to the fact that .serveStatic is an handler and doesn't register any endpoint. Is there a way around this, beyond using two endpoints (it's just for brevity I guess, not having to reimplement a function to serve the file).