Have you had a look at
A user-hook will be called for every GET
* A GET request is received containing a special character,
* usually a question mark.
* const char *pcURLData; // A request, e.g. “/request?temperature=?”
* char *pcBuffer; // Here the answer can be written
* size_t uxBufferLength; // Size of the buffer
static int temp = 23;
size_t uxApplicationHTTPHandleRequestHook( const char *pcURLData, char *pcBuffer, size_t uxBufferLength )
const char pcMyRequest = “temperature=?”;
pcURLData = strchr( pcURLData, '?' );
if( ( pcURLData != NULL ) && ( strncmp( pcMyRequest, pcURLData + 1, sizeof( pcMyRequest ) - 1 ) == 0 ) )
xResult = snprintf( pcBuffer, uxBufferLength, "/request?temperature=%d", xGetTemperature() );
xResult = 0;
In the same way, it is also possible to respond to complex JSON expressions.
As long as the hook returns zero, the url after GET is treated as a filename like here:
Here is a more complex JSON example:
The question-mark itself may never be used in an url that indicates a file name. So the hook will first test on the occurrence of a
. If present, the request needs special treatment.
I hope this makes sense?