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