DiCE API nvidia_logo_transpbg.gif Up
mi::http::IResponse Class Referenceabstract

This interface holds all the parameters of a response. More...

#include <http.h>

Public Member Functions

virtual void set_result_code (Sint32 code, const char *message)=0
 Sets the result code of the response. More...
 
virtual Sint32 get_result_code () const =0
 Returns the result code of the response. More...
 
virtual void set_header (const char *key, const char *value)=0
 Changes a header of the response or adds a header to the response. More...
 
virtual void remove_header (const char *key)=0
 Removes a header from the response. More...
 
virtual const char * get_header (const char *key) const =0
 Returns a header from the response. More...
 
virtual bool get_header (Size index, const char **key_pointer, const char **value_pointer) const =0
 Returns the header with the given index. More...
 
virtual bool was_sent () const =0
 Indicates whether the response was already sent. More...
 

Detailed Description

This interface holds all the parameters of a response.

Note
A pointer to an mi::http::IResponse interface is only valid as long as the mi::http::IConnection interface from which it was obtained is valid. The same is true for all strings obtained from the response. Overwriting such a string using the supplied functions will invalidate the obtained string.
This interface is not derived from mi::base::IInterface. As one consequence, there are no retain() and release() methods, and the interface cannot be used together with the mi::base::Handle class.

Member Function Documentation

 get_header() [1/2]

virtual const char * mi::http::IResponse::get_header ( const char *  key) const
pure virtual

Returns a header from the response.

Parameters
keyThe key of the header.
Returns
The value of the header, or NULL if the header was not found.

 get_header() [2/2]

virtual bool mi::http::IResponse::get_header ( Size  index,
const char **  key_pointer,
const char **  value_pointer 
) const
pure virtual

Returns the header with the given index.

Can be used for iterating over all headers by starting with index equal to 0 and then incrementing index until false is returned. When false is returned, key_pointer and value_pointer will not be written.

Parameters
indexThe index of the header.
[out]key_pointerA pointer to the header's key.
[out]value_pointerA pointer to the header's value.
Returns
true, if there is a header for given index, false otherwise.

 get_result_code()

virtual Sint32 mi::http::IResponse::get_result_code ( ) const
pure virtual

Returns the result code of the response.

 remove_header()

virtual void mi::http::IResponse::remove_header ( const char *  key)
pure virtual

Removes a header from the response.

Parameters
keyThe key of the header.

 set_header()

virtual void mi::http::IResponse::set_header ( const char *  key,
const char *  value 
)
pure virtual

Changes a header of the response or adds a header to the response.

Parameters
keyThe key of the header.
valueThe value of the header.

 set_result_code()

virtual void mi::http::IResponse::set_result_code ( Sint32  code,
const char *  message 
)
pure virtual

Sets the result code of the response.

Parameters
codeThe new result code.
messageThe corresponding string for code.

 was_sent()

virtual bool mi::http::IResponse::was_sent ( ) const
pure virtual

Indicates whether the response was already sent.