HttpResponse.h
Go to the documentation of this file.
static String toString(const HttpResponse &res)
Tries to present a readable version of the response.
Definition: HttpResponse.h:194
bool sendNamedStream(IDataSourceStream *newDataStream)
Parse and send stream, using the name to determine the content type.
HttpResponse * setContentType(const String &type)
Definition: HttpResponse.h:69
HttpResponse * setAllowCrossDomainOrigin(const String &controlAllowOrigin)
Definition: HttpResponse.h:91
bool isSuccess()
Determine if the response status indicates success.
Definition: HttpResponse.h:177
HttpResponse * setContentType(enum MimeType type)
Definition: HttpResponse.h:75
bool sendString(const String &text)
String toString() const
Tries to present a readable version of the current response values.
bool sendTemplate(IDataSourceStream *newTemplateInstance)
Parse and send template file.
Definition: HttpResponse.h:111
HttpResponse * setHeader(const String &name, const String &value)
Definition: HttpResponse.h:82
bool sendFile(const String &fileName, bool allowGzipFileCheck=true)
Send file by name.
String getBody()
Moves content from the body stream into a String.
Definition: HttpResponse.h:149
bool sendDataStream(IDataSourceStream *newDataStream, enum MimeType type)
Send data from the given stream object.
Definition: HttpResponse.h:128
HttpResponse * setCookie(const String &name, const String &value, bool append=false)
ReadWriteStream * buffer
Internal stream for storing strings and receiving responses.
Definition: HttpResponse.h:205
virtual bool moveString(String &s)
Memory-based streams may be able to move content into a String.
Definition: DataSourceStream.h:194
HttpResponse * setCache(int maxAgeSeconds=3600, bool isPublic=false)
void setBuffer(ReadWriteStream *buffer)
Called by connection to specify where incoming response data is written.
Represents either an incoming or outgoing response to a HTTP request.
Definition: HttpResponse.h:25