This interface holds all the parameters of a response.
More...
#include <http.h>
|
| 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...
|
| |
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.
◆ 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
-
| key | The key of the header. |
- Returns
- The value of the header, or
nullptr 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
-
| index | The index of the header. |
| [out] | key_pointer | A pointer to the header's key. |
| [out] | value_pointer | A 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
-
| key | The 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
-
| key | The key of the header. |
| value | The 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
-
| code | The new result code. |
| message | The corresponding string for code. |
◆ was_sent()
| virtual bool mi::http::IResponse::was_sent |
( |
| ) |
const |
|
pure virtual |
Indicates whether the response was already sent.