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.

CC3220MODA: HTTP server - parsing meta data

Part Number: CC3220MODA

Hello, 

I'm trying to implement custom HTTP server based on "portable" example and custom HTML file.

CC3220 works as AP and PC/Phone is running HTML as a client.

Sending / receiving GET and POST requests works well in both directions.

Question:

When the client sends GET request with "/get_id" endpoint, I get the SL_NETAPP_REQEUST_HTTP_GET event at SimpleLinkNetAppRequestEventHandler.

I've checked (pNetAppRequest->requestData.pMetadata) and I found "HTTP 1.1 /get_id" in TLV format as described in 9.7.1 Metadata Description in SWRU455M.

Seeing as HTTP_GET event is issued in event handler, I guess embedded HTTP server parses most of data.

What is correct procedure to retrieve an endpoint (or all required meta data)?

Parsing raw TLV buffer would be ok but I just wondered if there is a decent way to do it or is there better procedure.

Thanks,

Yun

  • So you are not implementing the HTTP server, but use the internal HTTP server and just want to support specific URI on the host, right?

    Check the mqtt_client example in SDK6.10. Under the ifmod/folder you'll find the httpsrv_if module that simplifies the support of this use-case (check the header_if.h for the new simplified API).

    The interface is used by ota_if (to support the local OTA use case) which will be a good reference.

    br,

    Kobi

  • Hi Kobi,

    I'm already working on implementing a HTTP server as SWRU455 describes.

    I just wondered if an URI can be parsed automatically just like it distinguishes GET/POST request automatically.

    As the document suggests an example function to parse HTTP meta data, maybe this is the only way.

    Thanks,

    Yun

  • The URI is received with the metadata (SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_REQUEST_URI).