ObjFW
Toggle main menu visibility
Loading...
Searching...
No Matches
OFHTTPResponse.h
1
/*
2
* Copyright (c) 2008-2026 Jonathan Schleifer <js@nil.im>
3
*
4
* All rights reserved.
5
*
6
* This program is free software: you can redistribute it and/or modify it
7
* under the terms of the GNU Lesser General Public License version 3.0 only,
8
* as published by the Free Software Foundation.
9
*
10
* This program is distributed in the hope that it will be useful, but WITHOUT
11
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13
* version 3.0 for more details.
14
*
15
* You should have received a copy of the GNU Lesser General Public License
16
* version 3.0 along with this program. If not, see
17
* <https://www.gnu.org/licenses/>.
18
*/
19
20
#import "
OFStream.h
"
21
#import "
OFHTTPRequest.h
"
22
23
OF_ASSUME_NONNULL_BEGIN
24
25
@class
OFDictionary
OF_GENERIC(KeyType, ObjectType);
26
@class
OFArray
OF_GENERIC(ObjectType);
27
33
#if !defined(OF_HTTP_CLIENT_M) && !defined(OF_HTTP_SERVER_M)
34
OF_SUBCLASSING_RESTRICTED
35
#endif
36
@interface
OFHTTPResponse
:
OFStream
37
{
38
OFHTTPRequestProtocolVersion
_protocolVersion;
39
short
_statusCode;
40
OFDictionary
OF_GENERIC(
OFString
*,
OFString
*) *_headers;
41
}
42
49
@property
(nonatomic)
OFHTTPRequestProtocolVersion
protocolVersion;
50
59
@property
(copy, nonatomic)
OFString
*protocolVersionString;
60
64
@property
(nonatomic)
short
statusCode
;
65
69
@property
(
copy
, nonatomic)
OFDictionary
OF_GENERIC(
OFString
*,
OFString
*)
70
*
headers
;
71
78
- (
OFString
*)
readString
;
79
86
- (
OFString
*)readStringWithEncoding: (
OFStringEncoding
)encoding;
87
@end
88
89
#ifdef __cplusplus
90
extern
"C"
{
91
#endif
98
extern
OFString
*_Nonnull OFHTTPStatusCodeString(
short
code);
99
#ifdef __cplusplus
100
}
101
#endif
102
103
OF_ASSUME_NONNULL_END
OFHTTPRequest.h
OFStream.h
OFStringEncoding
OFStringEncoding
The encoding of a string.
Definition
OFString.h:65
OFArray
An abstract class for storing objects in an array.
Definition
OFArray.h:111
OFDictionary
An abstract class for storing objects in a dictionary.
Definition
OFDictionary.h:85
OFHTTPResponse
A class for representing an HTTP request response as a stream.
Definition
OFHTTPResponse.h:37
OFHTTPResponse::statusCode
short statusCode
The status code of the response to the HTTP request.
Definition
OFHTTPResponse.h:64
-[OFHTTPResponse readString]
OFString * readString()
Read the response as a string, trying to detect the encoding and falling back to the specified encodi...
Definition
OFHTTPResponse.m:298
OFHTTPResponse::headers
OFDictionary * headers
The headers of the response to the HTTP request.
Definition
OFHTTPResponse.h:70
+[OFObject copy]
id copy()
Returns the class.
Definition
OFObject.m:1326
OFStream
A base class for different types of streams.
Definition
OFStream.h:280
OFString
A class for handling strings.
Definition
OFString.h:144
OFHTTPRequestProtocolVersion
The HTTP version of the HTTP request.
Definition
OFHTTPRequest.h:60
src
OFHTTPResponse.h
Generated by
1.17.0