@@ -16,10 +16,10 @@ Class Constructor
16
16
17
17
Creates the ESP8266WebServer class object.
18
18
19
- *Parameters: *
19
+ *Parameters: *
20
20
21
21
host IP address: ``IPaddress addr `` (optional)
22
-
22
+
23
23
host port number: ``int port `` (default is the standard HTTP port 80)
24
24
25
25
Basic Operations
@@ -61,7 +61,7 @@ Client request handlers
61
61
void onNotFound();
62
62
void onFileUpload();
63
63
64
- *Example: *
64
+ *Example: *
65
65
66
66
.. code :: cpp
67
67
@@ -75,7 +75,7 @@ Client request filters
75
75
^^^^^^^^^^^^^^^^^^^^^^
76
76
77
77
.. code :: cpp
78
-
78
+
79
79
RequestHandler<ServerType>& setFilter();
80
80
81
81
*Example: *
@@ -110,10 +110,10 @@ Getting information about request arguments
110
110
111
111
.. code :: cpp
112
112
113
- const String & arg();
114
- const String & argName();
113
+ const String & arg(int );
114
+ const String & argName(int );
115
115
int args();
116
- bool hasArg();
116
+ bool hasArg(const String& );
117
117
118
118
``arg `` - get request argument value, use ``arg("plain") `` to get POST body
119
119
@@ -133,14 +133,14 @@ Getting information about request headers
133
133
const String & hostHeader();
134
134
int headers();
135
135
bool hasHeader();
136
-
136
+
137
137
138
138
``header `` - get request header value
139
139
140
140
``headerName `` - get request header name
141
141
142
142
``hostHeader `` - get request host header if available, else empty string
143
-
143
+
144
144
``headers `` - get header count
145
145
146
146
``hasHeader `` - check if header exist
@@ -165,20 +165,32 @@ Authentication
165
165
server.requestAuthentication();
166
166
}
167
167
168
+ Getting information about request path arguments
169
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
170
+
171
+ .. code :: cpp
172
+
173
+ const String & pathArg(int) const;
174
+ int pathArgs() const;
175
+
176
+ ``pathArg `` - get request path argument by index (starting with 0)
177
+
178
+ ``pathArgs `` - get path arguments count, make sure to check it before accessing ``pathArg `` value
179
+
168
180
169
181
Other Function Calls
170
182
~~~~~~~~~~~~~~~~~~~~
171
183
172
184
.. code :: cpp
173
185
174
186
const String & uri(); // get the current uri
175
- HTTPMethod method(); // get the current method
187
+ HTTPMethod method(); // get the current method
176
188
WiFiClient & client(); // get the current client
177
189
HTTPUpload & upload(); // get the current upload
178
190
void setContentLength(); // set content length
179
191
void sendHeader(); // send HTTP header
180
192
void sendContent(); // send content
181
- void sendContent_P();
193
+ void sendContent_P();
182
194
void collectHeaders(); // set the request headers to collect
183
195
void serveStatic();
184
196
size_t streamFile();
0 commit comments