ObjFW
OFHTTPResponse.h
1 /*
2  * Copyright (c) 2008-2024 Jonathan Schleifer <js@nil.im>
3  *
4  * All rights reserved.
5  *
6  * This file is part of ObjFW. It may be distributed under the terms of the
7  * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
8  * the packaging of this file.
9  *
10  * Alternatively, it may be distributed under the terms of the GNU General
11  * Public License, either version 2 or 3, which can be found in the file
12  * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
13  * file.
14  */
15 
16 #import "OFStream.h"
17 #import "OFHTTPRequest.h"
18 
19 OF_ASSUME_NONNULL_BEGIN
20 
21 @class OFDictionary OF_GENERIC(KeyType, ObjectType);
22 @class OFArray OF_GENERIC(ObjectType);
23 
29 #if !defined(OF_HTTP_CLIENT_M) && !defined(OF_HTTP_SERVER_M)
30 OF_SUBCLASSING_RESTRICTED
31 #endif
33 {
34  OFHTTPRequestProtocolVersion _protocolVersion;
35  short _statusCode;
36  OFDictionary OF_GENERIC(OFString *, OFString *) *_headers;
37 }
38 
45 @property (nonatomic) OFHTTPRequestProtocolVersion protocolVersion;
46 
55 @property (copy, nonatomic) OFString *protocolVersionString;
56 
60 @property (nonatomic) short statusCode;
61 
65 @property (copy, nonatomic) OFDictionary OF_GENERIC(OFString *, OFString *)
67 
74 - (OFString *)readString;
75 
82 - (OFString *)readStringWithEncoding: (OFStringEncoding)encoding;
83 @end
84 
85 #ifdef __cplusplus
86 extern "C" {
87 #endif
94 extern OFString *_Nonnull OFHTTPStatusCodeString(short code);
95 #ifdef __cplusplus
96 }
97 #endif
98 
99 OF_ASSUME_NONNULL_END
OFStringEncoding
The encoding of a string.
Definition: OFString.h:61
An abstract class for storing objects in an array.
Definition: OFArray.h:105
An abstract class for storing objects in a dictionary.
Definition: OFDictionary.h:80
A class for representing an HTTP request response as a stream.
Definition: OFHTTPResponse.h:33
OFDictionary * headers
The headers of the response to the HTTP request.
Definition: OFHTTPResponse.h:66
A base class for different types of streams.
Definition: OFStream.h:188
A class for handling strings.
Definition: OFString.h:135
The HTTP version of the HTTP request.
Definition: OFHTTPRequest.h:56