Module: Internet Protocols Module Package: HTTP
RWHttpRequestStreamBodyRWHttpRequestBody
clone() getContentLength() |
getNextChunk() getStream() |
isValid() RWHttpRequestStreamBody() |
setStream() ~RWHttpRequestStreamBody() |
#include <rw/http/RWHttpRequestStreamBody.h>
RWHttpRequestStreamBody defines how to read a streamed message body.
RWHttpRequestStreamBody();
Constructs a default RWHttpRequestStreamBody object.
RWHttpRequestStreamBody(RW_SL_IO_STD(istream*) istr, int length=-1);
Constructs an RWHttpRequestStreamBody from a stream, where length is the length of the stream. If the length is not set, the stream is invalid.
RWHttpRequestStreamBody( const RWHttpRequestStreamBody& streamBody);
Copy constructor.
virtual ~RWHttpRequestStreamBody();
Virtual destructor.
virtual RWHttpRequestBody* clone() const;
Creates a copy of the RWHttpRequestStreamBody 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.
RW_SL_IO_STD(istream&) getStream(void) const;
Returns the underlying stream.
virtual bool isValid() const;
Returns true if the pointer to the stream is not null and the associated stream object is good().
void setStream(RW_SL_IO_STD(istream&) istrm, int length=-1);
Assigns the underlying stream to istrm.
© 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.