File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -141,21 +141,28 @@ String ESPWebServer::arg(String name) {
141
141
}
142
142
143
143
String ESPWebServer::arg (int i) {
144
- // TODO
145
- HTTPS_LOGE (" arg(int) not yet implemented" );
144
+ ResourceParameters *params = _activeRequest->getParams ();
145
+ int idx=0 ;
146
+ for (auto it=params->beginQueryParameters (); it != params->endQueryParameters (); it++, idx++) {
147
+ if (idx == i)
148
+ return String (it->second .c_str ());
149
+ }
146
150
return " " ;
147
151
}
148
152
149
153
String ESPWebServer::argName (int i) {
150
- // TODO
151
- HTTPS_LOGE (" argName() not yet implemented" );
154
+ ResourceParameters *params = _activeRequest->getParams ();
155
+ int idx=0 ;
156
+ for (auto it=params->beginQueryParameters (); it != params->endQueryParameters (); it++, idx++) {
157
+ if (idx == i)
158
+ return String (it->first .c_str ());
159
+ }
152
160
return " " ;
153
161
}
154
162
155
163
int ESPWebServer::args () {
156
- // TODO
157
- HTTPS_LOGE (" args() not yet implemented" );
158
- return 0 ;
164
+ ResourceParameters *params = _activeRequest->getParams ();
165
+ return params->getQueryParameterCount ();
159
166
}
160
167
161
168
bool ESPWebServer::hasArg (String name) {
You can’t perform that action at this time.
0 commit comments