SourcePro® API Reference Guide

Product Documentation:
   SourcePro
Documentation Home
List of all members | Public Member Functions | Private Member Functions | Friends
RWHttpReply Class Reference

Encapsulates HTTP headers and a protocol reply. More...

#include <rw/http/RWHttpReply.h>

Inheritance diagram for RWHttpReply:
RWNumReply RWReply

Public Member Functions

 RWHttpReply (void)
 
 RWHttpReply (const RWPortal &portal, const RWHttpRequest &request)
 
 RWHttpReply (const RWHttpReply &reply)
 
RWCString asString () const
 
RWCString getBody (void) const
 
RWHttpHeaderList getHeaders () const
 
int getMajorVersion (void) const
 
int getMinorVersion (void) const
 
RWHttpRequest getRequest (void) const
 
RWHttpReplyoperator= (const RWHttpReply &reply)
 
void setBody (const RWCString &body)
 
RWCString versionAsString (void) const
 
- Public Member Functions inherited from RWNumReply
 RWNumReply (void)
 
 RWNumReply (const RWNumReply &r)
 
virtual ~RWNumReply (void)
 
void clearAndDestroy (void)
 
size_t entries (void) const
 
RWCString getData (void) const
 
unsigned int getStatusCode (void) const
 
bool is1XX (void) const
 
bool is2XX (void) const
 
bool is3XX (void) const
 
bool is4XX (void) const
 
bool is5XX (void) const
 
RWNumReplyoperator= (const RWNumReply &reply)
 
const RWNumReplyLineoperator[] (size_t i) const
 
- Public Member Functions inherited from RWReply
 RWReply (void)
 
virtual ~RWReply (void)
 
virtual bool isComplete (void) const
 
virtual bool isValid (void) const
 

Private Member Functions

virtual void readFromPortal (const RWPortal &portal)
 

Friends

std::ostream & operator<< (std::ostream &str, const RWHttpReply &r)
 

Additional Inherited Members

- Protected Member Functions inherited from RWNumReply
void append (RWNumReplyLine &r)
 
void copy (const RWNumReply &r)
 
virtual void parse (void)
 
void readFromPortal (const RWPortal &portal)
 
- Protected Attributes inherited from RWReply
bool complete_
 
bool valid_
 

Detailed Description

RWHttpReply encapsulates HTTP headers and a protocol reply. It is a subclass of RWNumReply and includes additional methods for retrieving HTTP header information.

Constructor & Destructor Documentation

RWHttpReply::RWHttpReply ( void  )
inline

Constructs a default invalid RWHttpReply object.

RWHttpReply::RWHttpReply ( const RWPortal portal,
const RWHttpRequest request 
)

Constructs an RWHttpReply with portal as the data source. request is a reference to the RWHttpRequest object that was sent to the server to generate the reply.

RWHttpReply::RWHttpReply ( const RWHttpReply reply)
inline

Copy constructor.

Member Function Documentation

RWCString RWHttpReply::asString ( ) const

Returns an RWCString representing the status line and header fields for the RWHttpReply instance. The returned string does not contain the message body of the reply. The RWCString should contain 7-bit US-ASCII data.

RWCString RWHttpReply::getBody ( void  ) const
inline

Retrieves the internal body associated with this reply object.

RWHttpHeaderList RWHttpReply::getHeaders ( ) const
inline

Returns an RWHttpHeaderList object containing all headers associated with this reply.

int RWHttpReply::getMajorVersion ( void  ) const
inline

Returns the HTTP major version number.

int RWHttpReply::getMinorVersion ( void  ) const
inline

Returns the HTTP minor version number.

RWHttpRequest RWHttpReply::getRequest ( void  ) const
inline

Returns a copy of the request that generated this reply.

RWHttpReply& RWHttpReply::operator= ( const RWHttpReply reply)

Sets self to the value of reply. The previous contents of self are lost.

virtual void RWHttpReply::readFromPortal ( const RWPortal portal)
privatevirtual

Reads data from portal to construct self. It must be overridden by derived classes.

Implements RWReply.

void RWHttpReply::setBody ( const RWCString body)
inline

Sets the internal body object of this reply.

RWCString RWHttpReply::versionAsString ( void  ) const
inline

Returns the HTTP version number as an RWCString. The RWCString should contain 7-bit US-ASCII data.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  str,
const RWHttpReply r 
)
friend

Outputs an RWHttpReply object to an std::ostream using the asString() member function.

Copyright © 2021 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.