Skip to content

Commit 9980d2c

Browse files
committed
formatting
1 parent 5af2e03 commit 9980d2c

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

libraries/ESP8266WebServer/README.rst

+20-8
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ Class Constructor
1616
1717
Creates the ESP8266WebServer class object.
1818

19-
*Parameters:*
19+
*Parameters:*
2020

2121
host IP address: ``IPaddress addr`` (optional)
22-
22+
2323
host port number: ``int port`` (default is the standard HTTP port 80)
2424

2525
Basic Operations
@@ -61,7 +61,7 @@ Client request handlers
6161
void onNotFound();
6262
void onFileUpload();
6363
64-
*Example:*
64+
*Example:*
6565

6666
.. code:: cpp
6767
@@ -75,7 +75,7 @@ Client request filters
7575
^^^^^^^^^^^^^^^^^^^^^^
7676

7777
.. code:: cpp
78-
78+
7979
RequestHandler<ServerType>& setFilter();
8080
8181
*Example:*
@@ -133,14 +133,14 @@ Getting information about request headers
133133
const String & hostHeader();
134134
int headers();
135135
bool hasHeader();
136-
136+
137137
138138
``header`` - get request header value
139139

140140
``headerName`` - get request header name
141141

142142
``hostHeader`` - get request host header if available, else empty string
143-
143+
144144
``headers`` - get header count
145145

146146
``hasHeader`` - check if header exist
@@ -165,20 +165,32 @@ Authentication
165165
server.requestAuthentication();
166166
}
167167
168+
Getting information about request path arguments
169+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
170+
171+
.. code:: cpp
172+
173+
const String & pathArg(unsigned 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+
168180

169181
Other Function Calls
170182
~~~~~~~~~~~~~~~~~~~~
171183

172184
.. code:: cpp
173185
174186
const String & uri(); // get the current uri
175-
HTTPMethod method(); // get the current method
187+
HTTPMethod method(); // get the current method
176188
WiFiClient & client(); // get the current client
177189
HTTPUpload & upload(); // get the current upload
178190
void setContentLength(); // set content length
179191
void sendHeader(); // send HTTP header
180192
void sendContent(); // send content
181-
void sendContent_P();
193+
void sendContent_P();
182194
void collectHeaders(); // set the request headers to collect
183195
void serveStatic();
184196
size_t streamFile();

0 commit comments

Comments
 (0)