Networking Http Data Text

Table of Contents

  1. HttpText
  2. Library

HttpText

This is a simple "Text" data repository.

Library

Includes

#include "http/client/data/HttpText.h"

Reference

HttpText(const string& encoding = "text/html")

Instantiates the object. You can set the encoding of the data here, it defaults to text/html.

const char* gets() const

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.

void puts(const char* str)

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

string& get()

Returns the text in the container as string.

void set(const string& str)

Sets the text in the container as string.

Examples

The Working With The Stack article's first example uses HttpText.


All wikipages