This repository was archived by the owner on Jun 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Examples #3
Open
tmedicci
wants to merge
5
commits into
igrr:master
Choose a base branch
from
tmedicci:examples
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Examples #3
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ec07ec1
Added debug log to verify parsed key-value pairs and fixed context to…
tmedicci 7b73643
GET method example added
tmedicci 58506b6
Added example function to documentation
tmedicci cf6c707
Added spaces between # and title/subtitle at README.md
tmedicci 60cddcc
Added POST example function.
tmedicci File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,46 @@ | ||
Simple HTTP server | ||
------------------ | ||
# Simple HTTP server | ||
|
||
This is a very minimal HTTP server I use in some of the projects. | ||
|
||
Absolutely not ready for any kind of production use. | ||
|
||
How to use | ||
---------- | ||
|
||
# How to use | ||
|
||
Really, please see above note. | ||
|
||
This directory is an ESP-IDF component. Clone it (or add it as a submodule) into the component directory of the project. | ||
|
||
|
||
Documentation | ||
------------- | ||
# Documentation | ||
|
||
None yet, but I tried to make the comments in the header file helpful. | ||
|
||
|
||
Example | ||
------- | ||
# Examples | ||
|
||
Examples functions at http server | ||
|
||
## GET Method Example | ||
|
||
`simple_GET_method_example()` function: | ||
|
||
None yet. | ||
* Add http_server.c and http_server.h as a component into your project. | ||
* Server initialization added into the example function, simply call it and it should work! | ||
* Receiving a GET request at /, http server response is a "Hello World, from ESP32!" html. | ||
|
||
## POST Method Example | ||
`simple_POST_method_example()` function: | ||
* As well as GET example, simply add http_server as a componente into your ESP-IDF project. | ||
* Server initialization added into the POST example function, simply call it and don't worry. | ||
* Post to / a pair of key-value where the key is 'key' and value some value you want to test. The example will show value content. If needed, increade log verbosity at `make menuconfig` to show all parsed key-value pairs. | ||
|
||
Debugging | ||
--------- | ||
# Debugging | ||
|
||
Increasing log level to "Verbose" should produce lots of output related to request handling. | ||
|
||
|
||
License | ||
------- | ||
# License | ||
|
||
GPL, see [LICENSE](LICENSE) file. Mostly because this is a very early version. Will be relicensed as something more reasonable later. | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why you did this? this code doesn't pass the form arguments correctly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense that form_ctx (or simply ctx argument) refers to events others than HTTP_HANDLE_DATA so when we are parsing urlencoded arguments we are using the "original" context?
It works this way for me.