15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#import "OFObject.h"
#import "OFSocket.h"
#import "OFString.h"
OF_ASSUME_NONNULL_BEGIN
@class OFURI;
@class OFDictionary OF_GENERIC(KeyType, ObjectType);
@class OFData;
@class OFString;
/** @file */
/**
* @brief The type of an HTTP request.
*/
|
|
|
|
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#import "OFObject.h"
#import "OFSocket.h"
#import "OFString.h"
OF_ASSUME_NONNULL_BEGIN
@class OFData;
@class OFDictionary OF_GENERIC(KeyType, ObjectType);
@class OFIRI;
@class OFString;
/** @file */
/**
* @brief The type of an HTTP request.
*/
|
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
|
* @class OFHTTPRequest OFHTTPRequest.h ObjFW/OFHTTPRequest.h
*
* @brief A class for storing HTTP requests.
*/
OF_SUBCLASSING_RESTRICTED
@interface OFHTTPRequest: OFObject <OFCopying>
{
OFURI *_URI;
OFHTTPRequestMethod _method;
OFHTTPRequestProtocolVersion _protocolVersion;
OFDictionary OF_GENERIC(OFString *, OFString *) *_Nullable _headers;
OFSocketAddress _remoteAddress;
bool _hasRemoteAddress;
}
/**
* @brief The URI of the HTTP request.
*/
@property (copy, nonatomic) OFURI *URI;
/**
* @brief The protocol version of the HTTP request.
*
* @throw OFUnsupportedVersionException The specified version cannot be set
* because it is not supported
*/
|
|
|
|
|
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
|
* @class OFHTTPRequest OFHTTPRequest.h ObjFW/OFHTTPRequest.h
*
* @brief A class for storing HTTP requests.
*/
OF_SUBCLASSING_RESTRICTED
@interface OFHTTPRequest: OFObject <OFCopying>
{
OFIRI *_IRI;
OFHTTPRequestMethod _method;
OFHTTPRequestProtocolVersion _protocolVersion;
OFDictionary OF_GENERIC(OFString *, OFString *) *_Nullable _headers;
OFSocketAddress _remoteAddress;
bool _hasRemoteAddress;
}
/**
* @brief The IRI of the HTTP request.
*/
@property (copy, nonatomic) OFIRI *IRI;
/**
* @brief The protocol version of the HTTP request.
*
* @throw OFUnsupportedVersionException The specified version cannot be set
* because it is not supported
*/
|
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
* @brief The remote address from which the request originates.
*
* @note The setter creates a copy of the remote address.
*/
@property OF_NULLABLE_PROPERTY (nonatomic) const OFSocketAddress *remoteAddress;
/**
* @brief Creates a new OFHTTPRequest with the specified URI.
*
* @param URI The URI for the request
* @return A new, autoreleased OFHTTPRequest
*/
+ (instancetype)requestWithURI: (OFURI *)URI;
/**
* @brief Initializes an already allocated OFHTTPRequest with the specified URI.
*
* @param URI The URI for the request
* @return An initialized OFHTTPRequest
*/
- (instancetype)initWithURI: (OFURI *)URI;
- (instancetype)init OF_UNAVAILABLE;
@end
#ifdef __cplusplus
extern "C" {
#endif
|
|
|
|
|
|
|
|
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
* @brief The remote address from which the request originates.
*
* @note The setter creates a copy of the remote address.
*/
@property OF_NULLABLE_PROPERTY (nonatomic) const OFSocketAddress *remoteAddress;
/**
* @brief Creates a new OFHTTPRequest with the specified IRI.
*
* @param IRI The IRI for the request
* @return A new, autoreleased OFHTTPRequest
*/
+ (instancetype)requestWithIRI: (OFIRI *)IRI;
/**
* @brief Initializes an already allocated OFHTTPRequest with the specified IRI.
*
* @param IRI The IRI for the request
* @return An initialized OFHTTPRequest
*/
- (instancetype)initWithIRI: (OFIRI *)IRI;
- (instancetype)init OF_UNAVAILABLE;
@end
#ifdef __cplusplus
extern "C" {
#endif
|