Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
E
esp32-http-server
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
esp32-http-server
Commits
2fa64334
Commit
2fa64334
authored
Jan 06, 2018
by
Ivan Grokhotkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add function to get (request | form) argument values
parent
fc44658b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
http_server.c
http_server.c
+11
-0
http_server.h
http_server.h
+4
-4
No files found.
http_server.c
View file @
2fa64334
...
...
@@ -384,6 +384,17 @@ int http_request_get_method(http_context_t ctx)
return
(
int
)
ctx
->
parser
.
method
;
}
const
char
*
http_request_get_arg_value
(
http_context_t
ctx
,
const
char
*
name
)
{
http_header_t
*
it
;
SLIST_FOREACH
(
it
,
&
ctx
->
request_args
,
list_entry
)
{
if
(
strcasecmp
(
name
,
it
->
name
)
==
0
)
{
return
it
->
value
;
}
}
return
NULL
;
}
esp_err_t
http_request_get_data
(
http_context_t
ctx
,
const
char
**
out_data_ptr
,
size_t
*
out_size
)
{
if
(
ctx
->
event
!=
HTTP_HANDLE_DATA
)
{
...
...
http_server.h
View file @
2fa64334
...
...
@@ -131,12 +131,12 @@ esp_err_t http_register_form_handler(http_server_t server, const char* uri_patte
int
events
,
http_handler_fn_t
callback
,
void
*
callback_arg
);
/**
* @brief Get value for given
form item name
* @brief Get value for given
URL argument of form argument
* @param http_ctx context passed to the handler
* @param name name of
form item
* @return pointer to the
form item
value, valid until the end of request
* @param name name of
URL or form argument
* @return pointer to the value, valid until the end of request
*/
const
char
*
http_request_get_
form
_value
(
http_context_t
http_ctx
,
const
char
*
name
);
const
char
*
http_request_get_
arg
_value
(
http_context_t
http_ctx
,
const
char
*
name
);
/**
* @brief Get request method
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment