You use the ESP8266WebServer library in the ESP8266 on the combined board. The reference is in the README file and the library has good examples.
The function to get the request's URL is server.uri()
.
Usually to process the GET request the URL is not read with uri()
function, but the resource part (the 'path') is matched with the on()
functions in setup()
as server.on("some/path", fncToHandle);
and the URL parameters of a GET request are parsed by the WebServer library and made available with a set of functions:
const String & arg();
const String & argName();
int args();
bool hasArg();
the standard url parameters are after ?
in form of name=value
, separated by &
like
/some/path?name=John&lastName=Smith
snippets from SimpleAuthentication example:
from setup()
server.on("/login", handleLogin);
from handleLogin
:
if (server.hasArg("USERNAME") && server.hasArg("PASSWORD")) {
if (server.arg("USERNAME") == "admin" && server.arg("PASSWORD") == "admin") {