noos::cloud::http_post Class Reference

use to store and pass POST data and realted info More...

#include <http_post.hpp>

Public Member Functions

 http_post (std::string boundary)
 preferred constructor More...
 
void add_content (const std::string name, const std::string content, bool newline)
 add multipart/form-data content to the POST data More...
 
void add_content (const std::string name, const std::string filename, const std::vector< noos::types::byte > bytes)
 adding content to the POST data More...
 
void end ()
 call once, closes the POST boundary
 
std::string to_string () const
 get the POST
 
unsigned int size () const
 get POST data Content-Length
 

Detailed Description

use to store and pass POST data and realted info

Version
0.7.0
Date
August 2016
Author
Maria Ramosm.ram.nosp@m.os@o.nosp@m.rteli.nosp@m.o.co.nosp@m..uk

Constructor & Destructor Documentation

noos::cloud::http_post::http_post ( std::string  boundary)

preferred constructor

Parameters
boundarymust be obtained from http_header::get_boundary()
See also
http_header

Member Function Documentation

void noos::cloud::http_post::add_content ( const std::string  name,
const std::string  content,
bool  newline 
)

add multipart/form-data content to the POST data

Parameters
nameof the form
contentis the value
newlineadds newline return at the end of content
void noos::cloud::http_post::add_content ( const std::string  name,
const std::string  filename,
const std::vector< noos::types::byte bytes 
)

adding content to the POST data

Parameters
nameis the name of the string variable
filenamewhich want to use
vectorcontains the data of the file in binary type
Warning
it will add newline return after the bytes

The documentation for this class was generated from the following file: