ObjFW  Diff

Differences From Artifact [ddd39acc1c]:

To Artifact [7576232cb8]:


10
11
12
13
14
15
16
17

18
19
20
21
22
23
24
25
26

27
28
29
30
31
32

33
34
35
36
37
38
39
40
41
42

43



44
45
46
47
48

49
50
51

52
53


54
55



56
57
58
59
60
61
62
63
64
65
66
67
68
69







70
71
72
73
74
75
76
77
78
79
80
81
82
 *
 * 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 "OFObject.h"


@class OFDataArray;
@class OFDictionary;

/*!
 * @brief A class for storing a reply to an HTTP request.
 */
@interface OFHTTPRequestReply: OFObject
{

	short statusCode;
	OFDataArray *data;
	OFDictionary *headers;
}

#ifdef OF_HAVE_PROPERTIES

@property (readonly) short statusCode;
@property (readonly, copy) OFDictionary *headers;
@property (readonly, retain) OFDataArray *data;
#endif

/*!
 * @brief Creates a new OFHTTPRequestReply.
 *
 * @param status The HTTP status code replied to the request
 * @param headers The headers replied to the request

 * @param data The data replied to the request



 * @return A new OFHTTPRequestReply
 */
+ replyWithStatusCode: (short)status
	      headers: (OFDictionary*)headers
		 data: (OFDataArray*)data;


/*!
 * @brief Initializes an already allocated OFHTTPRequestReply.

 *
 * @param status The HTTP status code replied to the request


 * @param headers The headers replied to the request
 * @param data The data replied to the request



 * @return An initialized OFHTTPRequestReply
 */
- initWithStatusCode: (short)status
	     headers: (OFDictionary*)headers
		data: (OFDataArray*)data;

/*!
 * @brief Returns the state code of the reply of the HTTP request.
 *
 * @return The status code of the reply of the HTTP request
 */
- (short)statusCode;

/*!







 * @brief Returns the headers of the reply of the HTTP request.
 *
 * @return The headers of the reply of the HTTP request
 */
- (OFDictionary*)headers;

/*!
 * @brief Returns the data received for the HTTP request.
 *
 * @return The data received for the HTTP request
 */
- (OFDataArray*)data;
@end







|
>

<



|

|

>

<




>
|
|
<



|

|
|
>
|
>
>
>
|

<
<
<
>


|
>

|
>
>
|
<
>
>
>
|

<
<
|


|

|




>
>
>
>
>
>
>
|

|




|

|

|

10
11
12
13
14
15
16
17
18
19

20
21
22
23
24
25
26
27
28

29
30
31
32
33
34
35

36
37
38
39
40
41
42
43
44
45
46
47
48
49



50
51
52
53
54
55
56
57
58
59

60
61
62
63
64


65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
 *
 * 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