SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
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 (const RWHttpReply &reply)
 
 RWHttpReply (const RWPortal &portal, const RWHttpRequest &request)
 
 RWHttpReply (void)
 
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 (const RWNumReply &r)
 
 RWNumReply (void)
 
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() [1/3]

RWHttpReply::RWHttpReply ( void )
inline

Constructs a default invalid RWHttpReply object.

◆ RWHttpReply() [2/3]

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() [3/3]

RWHttpReply::RWHttpReply ( const RWHttpReply & reply)
inline

Copy constructor.

Member Function Documentation

◆ asString()

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.

◆ getBody()

RWCString RWHttpReply::getBody ( void ) const
inline

Retrieves the internal body associated with this reply object.

◆ getHeaders()

RWHttpHeaderList RWHttpReply::getHeaders ( ) const
inline

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

◆ getMajorVersion()

int RWHttpReply::getMajorVersion ( void ) const
inline

Returns the HTTP major version number.

◆ getMinorVersion()

int RWHttpReply::getMinorVersion ( void ) const
inline

Returns the HTTP minor version number.

◆ getRequest()

RWHttpRequest RWHttpReply::getRequest ( void ) const
inline

Returns a copy of the request that generated this reply.

◆ operator=()

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

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

◆ readFromPortal()

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

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

Implements RWReply.

◆ setBody()

void RWHttpReply::setBody ( const RWCString & body)
inline

Sets the internal body object of this reply.

◆ versionAsString()

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 Symbol Documentation

◆ operator<<

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

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

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