![]() |
Fledge
An open source edge computing platform for industrial users
|
This class represents a parsed HTTP form data uploaded to SimpleWeb::Server<SimpleWeb::HTTP. More...
#include <form_data.h>
Classes | |
class | FieldValue |
Public Member Functions | |
FormData (std::shared_ptr< SimpleWeb::Server< SimpleWeb::HTTP >::Request > request) | |
void | getUploadedData (const std::string &field, FieldValue &data) |
Fetch content data uploaded without file, example curl -v -v -v –output - -X POST -F 'attributes={"name": "B1", "type": "model"}' 127.0.0.1:43605/fledge/south/uploadA. More... | |
void | getUploadedFile (const std::string &field, FieldValue &data) |
Fetch content data uploaded as file, example curl -v -v -v –output - -X POST -F "bucket=@/some_path/file.bin" 127.0.0.1:43605/fledge/south/uploadA. More... | |
bool | saveFile (FieldValue &b, const std::string &fileName) |
Save the uploaded file. More... | |
This class represents a parsed HTTP form data uploaded to SimpleWeb::Server<SimpleWeb::HTTP.
FormData::FieldValue holds the field value as buffer start, size and filename if data comes form a file upload
FormData holds the input buffer, size and boundary multipart data
Public methods fetch value of a given field name and save file to filesystem
void FormData::getUploadedData | ( | const std::string & | field, |
FieldValue & | data | ||
) |
Fetch content data uploaded without file, example curl -v -v -v –output - -X POST -F 'attributes={"name": "B1", "type": "model"}' 127.0.0.1:43605/fledge/south/uploadA.
field | The field name to fetch |
data | The value reference to fill on success |
void FormData::getUploadedFile | ( | const std::string & | field, |
FieldValue & | data | ||
) |
Fetch content data uploaded as file, example curl -v -v -v –output - -X POST -F "bucket=@/some_path/file.bin" 127.0.0.1:43605/fledge/south/uploadA.
field | The field name (filename type) to fetch |
data | The value reference to fill on success |
bool FormData::saveFile | ( | FieldValue & | b, |
const std::string & | fileName | ||
) |
Save the uploaded file.
v | The Field value data |