Encapsulates reading an HTTP message body from an RWCString.
More...
#include <rw/http/RWHttpRequestStringBody.h>
RWHttpRequestStringBody defines how to read a standard message body.
RWHttpRequestStringBody::RWHttpRequestStringBody |
( |
| ) |
|
|
inline |
RWHttpRequestStringBody::RWHttpRequestStringBody |
( |
const RWCString & |
body | ) |
|
|
inline |
virtual RWHttpRequestStringBody::~RWHttpRequestStringBody |
( |
| ) |
|
|
virtual |
virtual int RWHttpRequestStringBody::getContentLength |
( |
| ) |
const |
|
virtual |
Returns the total length of the body object, if known. Returns -1
if the Content-Length
cannot be determined.
- Note
- An RWHttpRequestError exception is thrown if data without a
Content-Length
is sent to a server with version less than HTTP/1.1.
Implements RWHttpRequestBody.
virtual RWCString RWHttpRequestStringBody::getNextChunk |
( |
size_t |
size | ) |
|
|
virtual |
Reads and returns the next size bytes from the body as an RWCString. If size bytes are not available, the remainder of the string is returned. Returns an empty string when no more data can be read.
Implements RWHttpRequestBody.
RWCString RWHttpRequestStringBody::getString |
( |
| ) |
const |
|
inline |
Returns the internal body representation as an RWCString.
virtual bool RWHttpRequestStringBody::isValid |
( |
| ) |
const |
|
virtual |
void RWHttpRequestStringBody::setString |
( |
const RWCString & |
str | ) |
|
|
inline |
Stores the RWCString str as the internal body of the object.