ObjFW  Diff

Differences From Artifact [630572f8e2]:

To Artifact [f3d93005f7]:


18
19
20
21
22
23
24
25

26
27
28
29
30
31
32
18
19
20
21
22
23
24

25
26
27
28
29
30
31
32







-
+








#ifndef OF_HAVE_SOCKETS
# error No sockets available!
#endif

@class OFHTTPClient;
@class OFHTTPRequest;
@class OFHTTPRequestReply;
@class OFHTTPResponse;
@class OFURL;
@class OFTCPSocket;
@class OFDictionary;
@class OFDataArray;

/*!
 * @brief A delegate for OFHTTPClient.
93
94
95
96
97
98
99
100

101
102
103
104
105
106
107
93
94
95
96
97
98
99

100
101
102
103
104
105
106
107







-
+







 */
@interface OFHTTPClient: OFObject
{
	id <OFHTTPClientDelegate> _delegate;
	bool _insecureRedirectsAllowed;
	OFTCPSocket *_socket;
	OFURL *_lastURL;
	OFHTTPRequestReply *_lastReply;
	OFHTTPResponse *_lastResponse;
}

#ifdef OF_HAVE_PROPERTIES
@property (assign) id <OFHTTPClientDelegate> delegate;
@property bool insecureRedirectsAllowed;
#endif

137
138
139
140
141
142
143
144



145
146

147
148
149

150
151

152
153
154
155


156
157
158


159
160
161
162
163
164
165
166
167
137
138
139
140
141
142
143

144
145
146
147

148
149
150

151
152

153
154
155


156
157
158


159
160
161
162
163
164
165
166
167
168
169







-
+
+
+

-
+


-
+

-
+


-
-
+
+

-
-
+
+









 * @brief Returns whether redirects from HTTPS to HTTP will be allowed
 *
 * @return Whether redirects from HTTPS to HTTP will be allowed
 */
- (bool)insecureRedirectsAllowed;

/*!
 * @brief Performs the specified HTTP request
 * @brief Performs the specified HTTP request and returns an OFHTTPResponse.
 *
 * @return An OFHTTPResponse with the response for the HTTP request
 */
- (OFHTTPRequestReply*)performRequest: (OFHTTPRequest*)request;
- (OFHTTPResponse*)performRequest: (OFHTTPRequest*)request;

/*!
 * @brief Performs the HTTP request and returns an OFHTTPRequestReply.
 * @brief Performs the HTTP request and returns an OFHTTPResponse.
 *
 * @param request The request which was redirected
 * @param request The request to perform
 * @param redirects The maximum number of redirects after which no further
 *		    attempt is done to follow the redirect, but instead the
 *		    redirect is returned as an OFHTTPRequestReply
 * @return An OFHTTPRequestReply with the reply of the HTTP request
 *		    redirect is returned as an OFHTTPResponse
 * @return An OFHTTPResponse with the response for the HTTP request
 */
- (OFHTTPRequestReply*)performRequest: (OFHTTPRequest*)request
			    redirects: (size_t)redirects;
- (OFHTTPResponse*)performRequest: (OFHTTPRequest*)request
			redirects: (size_t)redirects;

/*!
 * @brief Closes connections that are still open due to keep-alive.
 */
- (void)close;
@end

@interface OFObject (OFHTTPClientDelegate) <OFHTTPClientDelegate>
@end