Artifact 7576232cb8ca5aab9dc98d1a8f0b6a49ec03972d16e8dd61831214409474f876:
- File
src/OFHTTPRequestReply.h
— part of check-in
[bdf9c4d96b]
at
2013-01-26 00:13:56
on branch trunk
— Make OFHTTPRequestReply a stream.
This also implements chunked transfer encoding for OFHTTPServer and adds
a property for the protocol version to OFHTTPRequest(Reply).Additionally, this makes it possible to add an async version of
OFHTTPClient. (user: js, size: 2562) [annotate] [blame] [check-ins using]
/* * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 * Jonathan Schleifer <js@webkeks.org> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in * the packaging of this file. * * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFStream.h" #import "OFHTTPRequest.h" @class OFDictionary; /*! * @brief A class for representing an HTTP request reply as a stream. */ @interface OFHTTPRequestReply: OFStream { of_http_request_protocol_version_t protocolVersion; short statusCode; OFDictionary *headers; } #ifdef OF_HAVE_PROPERTIES @property of_http_request_protocol_version_t protocolVersion; @property short statusCode; @property (copy) OFDictionary *headers; #endif /*! * @brief Sets the protocol version of the HTTP request reply. * * @param protocolVersion The protocol version of the HTTP request reply */ - (void)setProtocolVersion: (of_http_request_protocol_version_t)protocolVersion; /*! * @brief Returns the protocol version of the HTTP request reply. * * @return The protocol version of the HTTP request reply */ - (of_http_request_protocol_version_t)protocolVersion; /*! * @brief Sets the protocol version of the HTTP request reply to the version * described by the specified string. * * @param string A string describing an HTTP version */ - (void)setProtocolVersionFromString: (OFString*)string; /*! * @brief Returns the protocol version of the HTTP request reply as a string. * * @return The protocol version of the HTTP request reply as a string */ - (OFString*)protocolVersionString; /*! * @brief Returns the status code of the reply to the HTTP request. * * @return The status code of the reply to the HTTP request */ - (short)statusCode; /*! * @brief Sets the status code of the reply to the HTTP request. * * @param statusCode The status code of the reply to the HTTP request */ - (void)setStatusCode: (short)statusCode; /*! * @brief Returns the headers of the reply to the HTTP request. * * @return The headers of the reply to the HTTP request */ - (OFDictionary*)headers; /*! * @brief Returns the headers of the reply to the HTTP request. * * @param headers The headers of the reply to the HTTP request */ - (void)setHeaders: (OFDictionary*)headers; @end