NetServices Stack source

Dependents:   HelloWorld ServoInterfaceBoardExample1 4180_Lab4

Embed: (wiki syntax)

« Back to documentation index

HTTPText Class Reference

HTTPText Class Reference

HTTP Client data container for text. More...

#include <HTTPText.h>

Inherits HTTPData.

Public Member Functions

 HTTPText (const string &encoding="text/html", int maxSize=DEFAULT_MAX_MEM_ALLOC)
 Instantiates the object.
const char * gets () const
 Gets text.
void puts (const char *str)
 Sets the text in the container using a zero-terminated char*.
string & get ()
 Gets text.
void set (const string &str)
 Puts text.
virtual void clear ()
 Clears the content.

Friends

class HTTPClient

Detailed Description

HTTP Client data container for text.

This is a simple "Text" data repository for HTTP requests.

Definition at line 40 of file HTTPText.h.


Constructor & Destructor Documentation

HTTPText ( const string &  encoding = "text/html",
int  maxSize = DEFAULT_MAX_MEM_ALLOC 
)

Instantiates the object.

Parameters:
encodingencoding of the data, it defaults to text/html.
maxSizedefines the maximum memory size that can be allocated by the object. It defaults to 512 bytes.

Definition at line 30 of file HTTPText.cpp.


Member Function Documentation

void clear (  ) [virtual]

Clears the content.

If this container is used as a data sink, it is cleared by the HTTP Client at the beginning of the request.

Definition at line 60 of file HTTPText.cpp.

string & get (  )

Gets text.

Returns the text in the container as string.

Definition at line 50 of file HTTPText.cpp.

const char * gets (  ) const

Gets text.

Returns the text in the container as a zero-terminated char*. The array returned points to the internal buffer of the object and remains owned by the object.

Definition at line 40 of file HTTPText.cpp.

void puts ( const char *  str )

Sets the text in the container using a zero-terminated char*.

Definition at line 45 of file HTTPText.cpp.

void set ( const string &  str )

Puts text.

Sets the text in the container as string.

Definition at line 55 of file HTTPText.cpp.