Module: Internet Protocols Module Package: HTTP
RWHttpRequestStringBodyRWHttpRequestBody
clone() getContentLength() |
getNextChunk() getString() |
isValid() RWHttpRequestStringBody() |
setString() ~RWHttpRequestStringBody() |
#include <rw/http/RWHttpRequestStringBody.h>
RWHttpRequestStringBody defines how to read a standard message body.
RWHttpRequestStringBody();
Constructs a default RWHttpRequestStringBody object.
RWHttpRequestStringBody(const RWCString& body);
Constructs an RWHttpRequestStringBody from a string.
RWHttpRequestStringBody(const RWHttpRequestStringBody& body);
Copy constructor.
virtual ~RWHttpRequestStringBody();
Virtual destructor.
virtual RWHttpRequestBody* clone() const;
Creates a copy of the RWHttpRequestStringBody on the heap and returns a pointer to the newly allocated memory.
virtual int getContentLength() const;
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.
virtual RWCString getNextChunk(size_t size);
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.
RWCString getString(void) const;
Returns the internal body representation as an RWCString.
virtual bool isValid() const;
Always returns true for this derived class.
void setString(const RWCString& str);
Stores the RWCString str as the internal body of the object.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.