A stack which works with or without an Mbed os library. Provides IPv4 or IPv6 with a full 1500 byte buffer.

Dependents:   oldheating gps motorhome heating

tcp/http.cpp

Committer:
andrewboyson
Date:
2017-06-29
Revision:
21:02c82594c8c0
Parent:
10:f0854784e960
Child:
22:914b970356f0

File content as of revision 21:02c82594c8c0:

#include "mbed.h"
#include "time.h"
#include "http.h"

static void dateFromTm(struct tm* ptm, char* ptext)
{
    size_t size = strftime(ptext, HTTP_DATE_LENGTH, "%a, %d %b %Y %H:%M:%S GMT", ptm);//Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123
}
void HttpDateFromNow(char* pText)
{
    struct tm tm;
    TimeToTmUtc(time(NULL), &tm);
    dateFromTm(&tm, pText);
}
void HttpDateFromDateTime(const char* date, const char *ptime, char* ptext)
{
    struct tm tm;
    TimeAsciiDateTimeToTm(date, ptime, &tm);
    dateFromTm(&tm, ptext);
}