Fork HTTPClient and Modfiy code for mbed 6.0
Dependents: mbed-demo-http-get-json
data/HTTPFile.cpp
- Committer:
- WiredHome
- Date:
- 2014-03-15
- Revision:
- 23:517fec8b8b99
- Child:
- 24:eee214e3e806
File content as of revision 23:517fec8b8b99:
#include "HTTPFile.h" #if 0 HTTPFile::HTTPFile(char* filename) { file = fopen(filename, "w"); } void HTTPFile::close() { if (file) { fclose(file); } } void HTTPFile::writeReset() { if (file) { rewind(file); } } int HTTPFile::write(const char* buf, size_t len) { if (file) { len = fwrite(&buf, 1, len, file); if ((!m_chunked && (ftell(file) >= m_len)) || (m_chunked && !len)) { close(); } } return len; } void HTTPFile::setDataType(const char* type) { } void HTTPFile::setIsChunked(bool chunked) { m_chunked = chunked; } void HTTPFile::setDataLen(size_t len) { m_len = len; } #endif