The Ethernet library does just that. You are layers above in application space using HTTP and it’s up to you to parse the incoming GET air POST requests (or others) and answer accordingly
May be the asyncWebServer library can be hacked to use Ethernet instead of WiFi as the underlying transport layer
Thanks.
I have parsed the GET/POST as I wanted.
My only issue is that now I need multiple pages that can be accessed through the same IP but with different directory/subdirectory.
for example 192.168.1.177/settings will be a GET for /settings and 192.168.1.177/configurations will be a GET for /configurations
if you can parse the GET you know which page is requested. Then it's a matter of just returning the right content.
char * requestedURI; // extracted from the GET request, will be "/" or "/settings" or "/configurations"
... // extract URI from GET request
if (strcmp(requestedURI, "/") == 0) {
// here send the home page
...
}
else if (strcmp(requestedURI, "/settings") == 0) {
// here send the settings page
...
}
else if (strcmp(requestedURI, "/configurations") == 0) {
// here send the configurations page
...
}
else {
// here send the error HTTP 404, 404 not found error
...
}