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
 
const UT_StringHoldergetHeaderOrEmpty (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)
 
void addCookie (const NET_NetworkCookie &cookie)
 
void deleteCookie (const UT_StringRef &name)
 
bool hasCookie (const UT_StringRef &name) const
 
bool getCookie (const UT_StringRef &name, NET_NetworkCookie &cookie) const
 

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)
 
const UT_StringHoldergetHeaderOrEmpty (const UT_StringRef &header) const
 
UT_Optional< UT_StringHoldergetHeaderContentType ()
 
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 315 of file NET_WebResponse.h.

Member Typedef Documentation

Constructor & Destructor Documentation

NET_WebResponse::NET_WebResponse ( )
inline

Definition at line 320 of file NET_WebResponse.h.

NET_WebResponse::NET_WebResponse ( NET_HTTPStatusCode  code)
inline

Definition at line 325 of file NET_WebResponse.h.

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

Definition at line 330 of file NET_WebResponse.h.

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

Definition at line 336 of file NET_WebResponse.h.

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

Definition at line 346 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 359 of file NET_WebResponse.h.

Member Function Documentation

void NET_WebResponse::addCookie ( const NET_NetworkCookie cookie)
const UT_StringHolder& NET_WebResponse::boundary ( ) const
inline

Definition at line 514 of file NET_WebResponse.h.

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

Definition at line 454 of file NET_WebResponse.h.

void NET_WebResponse::clearFile ( )
inline

Definition at line 458 of file NET_WebResponse.h.

void NET_WebResponse::clearRanges ( )
inline

Definition at line 481 of file NET_WebResponse.h.

exint NET_WebResponse::contentLength ( ) const
inline

Definition at line 505 of file NET_WebResponse.h.

const UT_StringHolder& NET_WebResponse::contentType ( ) const
inline

Definition at line 506 of file NET_WebResponse.h.

const UT_StringHolder& NET_WebResponse::data ( ) const
inline

Definition at line 501 of file NET_WebResponse.h.

void NET_WebResponse::deleteCookie ( const UT_StringRef name)
const UT_StringHolder& NET_WebResponse::file ( ) const
inline

Definition at line 516 of file NET_WebResponse.h.

bool NET_WebResponse::getCookie ( const UT_StringRef name,
NET_NetworkCookie cookie 
) const
const UT_StringHolder& NET_WebResponse::getHeaderOrEmpty ( const UT_StringRef header) const
inline

Definition at line 386 of file NET_WebResponse.h.

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

Definition at line 382 of file NET_WebResponse.h.

bool NET_WebResponse::hasMoreData ( ) const
inline

Definition at line 519 of file NET_WebResponse.h.

const HeaderMap& NET_WebResponse::headers ( ) const
inline

Definition at line 507 of file NET_WebResponse.h.

bool NET_WebResponse::isChunked ( ) const
inline

Definition at line 378 of file NET_WebResponse.h.

bool NET_WebResponse::isFile ( ) const
inline

Definition at line 376 of file NET_WebResponse.h.

bool NET_WebResponse::isTempFile ( ) const
inline

Definition at line 515 of file NET_WebResponse.h.

bool NET_WebResponse::isUpgrade ( ) const
inline

Definition at line 508 of file NET_WebResponse.h.

bool NET_WebResponse::keepAlive ( ) const
inline

Definition at line 520 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 366 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 513 of file NET_WebResponse.h.

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

Definition at line 422 of file NET_WebResponse.h.

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

Definition at line 436 of file NET_WebResponse.h.

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

Definition at line 391 of file NET_WebResponse.h.

void NET_WebResponse::setErrors ( const UT_StringHolder errors)
inline

Definition at line 509 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 410 of file NET_WebResponse.h.

void NET_WebResponse::setJSON ( const UT_StringHolder body)
inline

Definition at line 448 of file NET_WebResponse.h.

void NET_WebResponse::setKeepAlive ( bool  keep_alive)
inline

Definition at line 521 of file NET_WebResponse.h.

void NET_WebResponse::setRanges ( const NET_RequestRangeList ranges)
inline

Definition at line 465 of file NET_WebResponse.h.

void NET_WebResponse::setStatus ( NET_HTTPStatusCode  code)
inline

Definition at line 396 of file NET_WebResponse.h.

void NET_WebResponse::setText ( const UT_StringHolder body)
inline

Definition at line 444 of file NET_WebResponse.h.

bool NET_WebResponse::shouldClose ( ) const
inline

Definition at line 488 of file NET_WebResponse.h.

NET_HTTPStatusCode NET_WebResponse::status ( ) const
inline

Definition at line 406 of file NET_WebResponse.h.

Friends And Related Function Documentation

friend class NET_HttpIO
friend

Definition at line 557 of file NET_WebResponse.h.


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