ObjFW
OFHTTPResponse.h
1 /*
2  * Copyright (c) 2008-2021 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 
30 {
31  of_http_request_protocol_version_t _protocolVersion;
32  short _statusCode;
33  OFDictionary OF_GENERIC(OFString *, OFString *) *_headers;
34  OF_RESERVE_IVARS(OFHTTPResponse, 4)
35 }
36 
40 @property (nonatomic) of_http_request_protocol_version_t protocolVersion;
41 
45 @property (copy, nonatomic) OFString *protocolVersionString;
46 
50 @property (nonatomic) short statusCode;
51 
55 @property (copy, nonatomic) OFDictionary OF_GENERIC(OFString *, OFString *)
57 
61 @property (readonly, nonatomic) OFString *string;
62 
69 - (OFString *)stringWithEncoding: (of_string_encoding_t)encoding;
70 @end
71 
72 #ifdef __cplusplus
73 extern "C" {
74 #endif
81 extern OFString *_Nonnull of_http_status_code_to_string(short code);
82 #ifdef __cplusplus
83 }
84 #endif
85 
86 OF_ASSUME_NONNULL_END
of_string_encoding_t
The encoding of a string.
Definition: OFString.h:68
An abstract class for storing objects in an array.
Definition: OFArray.h:92
An abstract class for storing objects in a dictionary.
Definition: OFDictionary.h:58
A class for representing an HTTP request reply as a stream.
Definition: OFHTTPResponse.h:30
OFDictionary * headers
The headers of the reply to the HTTP request.
Definition: OFHTTPResponse.h:56
A base class for different types of streams.
Definition: OFStream.h:191
A class for handling strings.
Definition: OFString.h:132
The HTTP version of the HTTP request.
Definition: OFHTTPRequest.h:58