mi::http::IResponse Class Reference
[HTTP server]
Description
This interface holds all the parameters of a response.
-
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.
Public Member Functions
- 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 Sint32 get_result_code() const =0
- Returns the result code of the response.
- virtual void remove_header( const char* key) =0
- Removes a header from 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 set_result_code( Sint32 code, const char* message) =0
- Sets the result code of the response. More...
- virtual bool was_sent() const =0
- Indicates whether the response was already sent.
Member Functions
- virtual const char* mi::http::IResponse::get_header( const char* key) const [pure virtual]
-
Returns a header from the response.
Parameters
- key
- The key of the header.
Returns
The value of the header, or NULL if the header was not found.
- 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
- index
- The index of the header.
- key_pointer
- A pointer to the header's key.
- value_pointer
- A pointer to the header's value.
Returns
true , if there is a header for given index, false otherwise.
- virtual Sint32 mi::http::IResponse::get_result_code() const [pure virtual]
-
Returns the result code of the response.
- virtual void mi::http::IResponse::remove_header( const char* key) [pure virtual]
-
Removes a header from the response.
Parameters
- key
- The key of the 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
- key
- The key of the header.
- value
- The value of the header.
- virtual void mi::http::IResponse::set_result_code( Sint32 code, const char* message) [pure virtual]
-
Sets the result code of the response.
Parameters
- code
- The new result code.
- message
- The corresponding string for code.
- virtual bool mi::http::IResponse::was_sent() const [pure virtual]
-
Indicates whether the response was already sent.