HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NET_WebResponse Class Reference

Response object used for responding to request in the server. More...

#include <NET_WebResponse.h>

+ Inheritance diagram for NET_WebResponse:

Public Types

using HeaderMap = NET_BaseWebResponse::HeaderMap
 

Public Member Functions

 NET_WebResponse ()
 
 NET_WebResponse (NET_HTTPStatusCode code)
 
 NET_WebResponse (NET_HTTPStatusCode code, const UT_StringHolder &data)
 
 NET_WebResponse (NET_HTTPStatusCode code, const HeaderMap &headers, const UT_StringHolder &data)
 
 NET_WebResponse (NET_HTTPStatusCode code, const HeaderMap &headers)
 
 NET_WebResponse (const NET_WebResponse &resp)=default
 
NET_WebResponseoperator= (const NET_WebResponse &resp)=default
 
 NET_WebResponse (NET_WebResponse &&resp)=default
 
NET_WebResponseoperator= (NET_WebResponse &&resp)=default
 
 NET_WebResponse (const NET_HTTPResponse &resp)
 
NET_WebResponseoperator= (const NET_HTTPResponse &resp)
 
void clear ()
 
bool isFile () const
 
bool isChunked () const
 
bool hasHeader (const UT_StringRef &header) const
 
void setDefault (const UT_StringHolder &name, const UT_StringHolder &value)
 
void setStatus (NET_HTTPStatusCode code)
 
NET_HTTPStatusCode status () const
 
void setHeader (const UT_StringRef &name, const UT_StringRef &value)
 
void setHeaders (const HeaderMap &headers)
 
void patchHeader (const UT_StringHolder &name, const UT_StringHolder &value)
 
void setBody (const UT_StringHolder &body, const UT_StringRef &content_type="")
 
void setBodyChunk (const UT_StringHolder &body, bool has_more=false)
 
void setText (const UT_StringHolder &body)
 
void setJSON (const UT_StringHolder &body)
 
void setFile (const UT_StringHolder &file, bool delete_file)
 
void clearBody ()
 
void clearFile ()
 
void setRanges (const NET_RequestRangeList &ranges)
 
void clearRanges ()
 
bool shouldClose () const
 
const UT_StringHolderdata () const
 
exint contentLength () const
 
const UT_StringHoldercontentType () const
 
const HeaderMapheaders () const
 
bool isUpgrade () const
 
void setErrors (const UT_StringHolder &errors)
 
const NET_RequestRangeListranges () const
 
const UT_StringHolderboundary () const
 
bool isTempFile () const
 
const UT_StringHolderfile () const
 
bool hasMoreData () const
 
bool keepAlive () const
 
void setKeepAlive (bool keep_alive)
 

Friends

class NET_HttpIO
 

Additional Inherited Members

- Protected Types inherited from NET_BaseWebResponse
using HeaderMap = UT_ArrayStringMap< UT_StringHolder >
 
- Protected Member Functions inherited from NET_BaseWebResponse
 NET_BaseWebResponse ()
 
 NET_BaseWebResponse (NET_HTTPStatusCode code)
 
 NET_BaseWebResponse (NET_HTTPStatusCode code, const UT_StringHolder &data)
 
 NET_BaseWebResponse (NET_HTTPStatusCode code, const HeaderMap &headers, const UT_StringHolder &data)
 
 NET_BaseWebResponse (NET_HTTPStatusCode code, const HeaderMap &headers)
 
 operator bool () const
 
bool isSuccess () const
 
bool isRequestNotFound () const
 
bool isBadRequest () const
 
bool hasTimedout () const
 
UT_StringHolder headersAsString () const
 
bool hasHeader (const UT_StringRef &header) const
 
void setDefault (const UT_StringHolder &name, const UT_StringHolder &value)
 
UT_Optional< const
UT_StringHolder & > 
getHeaderContentType ()
 
const UT_StringHoldercontentTypeOrEmpty () const
 
UT_Optional< exintgetHeaderContentLength ()
 
bool hasContentType (const UT_StringRef &mime) const
 
NET_Time modTime () const
 
bool hasJSONBody () const
 
- Static Protected Member Functions inherited from NET_BaseWebResponse
static void stockMsgFromCode (NET_HTTPStatusCode code, UT_WorkBuffer &msg)
 
static bool isJSONBody (const HeaderMap &headers)
 
- Protected Attributes inherited from NET_BaseWebResponse
NET_HTTPStatusCode myStatus
 
HeaderMap myHeaders
 
UT_StringArray myCookies
 
UT_StringHolder myData
 

Detailed Description

Response object used for responding to request in the server.

Definition at line 287 of file NET_WebResponse.h.

Member Typedef Documentation

Constructor & Destructor Documentation

NET_WebResponse::NET_WebResponse ( )
inline

Definition at line 292 of file NET_WebResponse.h.

NET_WebResponse::NET_WebResponse ( NET_HTTPStatusCode  code)
inline

Definition at line 297 of file NET_WebResponse.h.

NET_WebResponse::NET_WebResponse ( NET_HTTPStatusCode  code,
const UT_StringHolder data 
)
inline

Definition at line 302 of file NET_WebResponse.h.

NET_WebResponse::NET_WebResponse ( NET_HTTPStatusCode  code,
const HeaderMap headers,
const UT_StringHolder data 
)
inline

Definition at line 308 of file NET_WebResponse.h.

NET_WebResponse::NET_WebResponse ( NET_HTTPStatusCode  code,
const HeaderMap headers 
)
inline

Definition at line 318 of file NET_WebResponse.h.

NET_WebResponse::NET_WebResponse ( const NET_WebResponse resp)
default
NET_WebResponse::NET_WebResponse ( NET_WebResponse &&  resp)
default
NET_WebResponse::NET_WebResponse ( const NET_HTTPResponse resp)
inline

Definition at line 331 of file NET_WebResponse.h.

Member Function Documentation

const UT_StringHolder& NET_WebResponse::boundary ( ) const
inline

Definition at line 482 of file NET_WebResponse.h.

void NET_WebResponse::clear ( )
void NET_WebResponse::clearBody ( )
inline

Definition at line 422 of file NET_WebResponse.h.

void NET_WebResponse::clearFile ( )
inline

Definition at line 426 of file NET_WebResponse.h.

void NET_WebResponse::clearRanges ( )
inline

Definition at line 449 of file NET_WebResponse.h.

exint NET_WebResponse::contentLength ( ) const
inline

Definition at line 473 of file NET_WebResponse.h.

const UT_StringHolder& NET_WebResponse::contentType ( ) const
inline

Definition at line 474 of file NET_WebResponse.h.

const UT_StringHolder& NET_WebResponse::data ( ) const
inline

Definition at line 469 of file NET_WebResponse.h.

const UT_StringHolder& NET_WebResponse::file ( ) const
inline

Definition at line 484 of file NET_WebResponse.h.

bool NET_WebResponse::hasHeader ( const UT_StringRef header) const
inline

Definition at line 354 of file NET_WebResponse.h.

bool NET_WebResponse::hasMoreData ( ) const
inline

Definition at line 487 of file NET_WebResponse.h.

const HeaderMap& NET_WebResponse::headers ( ) const
inline

Definition at line 475 of file NET_WebResponse.h.

bool NET_WebResponse::isChunked ( ) const
inline

Definition at line 350 of file NET_WebResponse.h.

bool NET_WebResponse::isFile ( ) const
inline

Definition at line 348 of file NET_WebResponse.h.

bool NET_WebResponse::isTempFile ( ) const
inline

Definition at line 483 of file NET_WebResponse.h.

bool NET_WebResponse::isUpgrade ( ) const
inline

Definition at line 476 of file NET_WebResponse.h.

bool NET_WebResponse::keepAlive ( ) const
inline

Definition at line 488 of file NET_WebResponse.h.

NET_WebResponse& NET_WebResponse::operator= ( const NET_WebResponse resp)
default
NET_WebResponse& NET_WebResponse::operator= ( NET_WebResponse &&  resp)
default
NET_WebResponse& NET_WebResponse::operator= ( const NET_HTTPResponse resp)
inline

Definition at line 338 of file NET_WebResponse.h.

void NET_WebResponse::patchHeader ( const UT_StringHolder name,
const UT_StringHolder value 
)
const NET_RequestRangeList& NET_WebResponse::ranges ( ) const
inline

Definition at line 481 of file NET_WebResponse.h.

void NET_WebResponse::setBody ( const UT_StringHolder body,
const UT_StringRef content_type = "" 
)
inline

Definition at line 390 of file NET_WebResponse.h.

void NET_WebResponse::setBodyChunk ( const UT_StringHolder body,
bool  has_more = false 
)
inline

Definition at line 404 of file NET_WebResponse.h.

void NET_WebResponse::setDefault ( const UT_StringHolder name,
const UT_StringHolder value 
)
inline

Definition at line 359 of file NET_WebResponse.h.

void NET_WebResponse::setErrors ( const UT_StringHolder errors)
inline

Definition at line 477 of file NET_WebResponse.h.

void NET_WebResponse::setFile ( const UT_StringHolder file,
bool  delete_file 
)
void NET_WebResponse::setHeader ( const UT_StringRef name,
const UT_StringRef value 
)
void NET_WebResponse::setHeaders ( const HeaderMap headers)
inline

Definition at line 378 of file NET_WebResponse.h.

void NET_WebResponse::setJSON ( const UT_StringHolder body)
inline

Definition at line 416 of file NET_WebResponse.h.

void NET_WebResponse::setKeepAlive ( bool  keep_alive)
inline

Definition at line 489 of file NET_WebResponse.h.

void NET_WebResponse::setRanges ( const NET_RequestRangeList ranges)
inline

Definition at line 433 of file NET_WebResponse.h.

void NET_WebResponse::setStatus ( NET_HTTPStatusCode  code)
inline

Definition at line 364 of file NET_WebResponse.h.

void NET_WebResponse::setText ( const UT_StringHolder body)
inline

Definition at line 412 of file NET_WebResponse.h.

bool NET_WebResponse::shouldClose ( ) const
inline

Definition at line 456 of file NET_WebResponse.h.

NET_HTTPStatusCode NET_WebResponse::status ( ) const
inline

Definition at line 374 of file NET_WebResponse.h.

Friends And Related Function Documentation

friend class NET_HttpIO
friend

Definition at line 520 of file NET_WebResponse.h.


The documentation for this class was generated from the following file: