This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3135: POST REQUEST Goes in SimpleLinkHttpServerEventHandler instead of SimpleLinkNetAppRequestEventHandler

Part Number: CC3135

Hi,

I couldn't find any resolution in the previous post.

He're my problem :

i'm using the out_of_the_box example and try to handle from the HTML page some queries.

So far managed to use GET/PUT and post working but i'm having trouble with post query with the the data in the body instead of the url.

this query is directly made with standard html form.

Theses query end up in the SimpleLinkHttpServerEventHandler  method instead of SimpleLinkNetAppRequestEventHandler, which is quite empty in the example 100

void SimpleLinkHttpServerEventHandler(
        SlNetAppHttpServerEvent_t *pHttpEvent,
        SlNetAppHttpServerResponse_t *pHttpResponse)
{
    /* Unused in this application */
    UART_PRINT("[HTTP SERVER EVENT] Unexpected HTTP server event \n\r");
}

Any idead of how to transfer back to SimpleLinkNetAppRequestEventHandler this form post query ?

Regards,

Théodore

  • Hi,

    Do you post to a already available (html) file that exists on the file system? This is the only way to get the SimpleLinkHttpServerEventHandler   

    In order to get the SimpleLinkNetAppRequestEventHandler, the URL should contain a virtual resource (that will only be handled by the host, so there can't be a file with the same name).

    The Local OTA and OOB examples uses HTTP Post to send the OTA (tar) image - which is handled by SimpleLinkNetAppRequestEventHandler.

    br,

    Kobi

  • Hi Kobi,

    I think i found the solution.

    When talking about "virtual resources", how do you define what's handled only by the host ?

    I've tried to figure how this looking at OTA and OOB examples.

    Is it only related to the file name or does the query paramaters such as __SL_P_N.A are also handled automatically by the system ?

    Does it mean "index.html" cannot be altered to query things ?

  • You should better refer to the programmer's guide (https://www.ti.com/lit/swru455).

    In general, if you try to access a resource (a HTML file, e.g. "index.html") that is available in the FS (e.g www/index.html), the host will not be invoked. If the file is unavailable - the host will be invoked (SimpleLinkNetAppRequestEventHandler).

    If the html file contains tokens then the reserved ones will be served by the NWP and the host will not be invoked. 

    If you have a HTML file that contains a token that is not recognized by the NWP, it will be forwarded to the host (SimpleLinkHttpServerEventHandler).