Overview
| Comment: | Rename -[OFHTTPRequest postData] to POSTData. |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
fbb9df7439bfb02260b4eac889d40bfa |
| User & Date: | js on 2012-12-14 01:42:05 |
| Other Links: | manifest | tags |
Context
|
2012-12-14
| ||
| 01:46 | Add -[description] for OFHTTPRequest(Result). (check-in: c3d536d43c user: js tags: trunk) | |
| 01:42 | Rename -[OFHTTPRequest postData] to POSTData. (check-in: fbb9df7439 user: js tags: trunk) | |
|
2012-12-13
| ||
| 21:38 | Remove code that got useless. (check-in: 4ce82f6e28 user: js tags: trunk) | |
Changes
Modified src/OFHTTPClient.m from [f1da42cb60] to [befaf122bc].
| ︙ | |||
117 118 119 120 121 122 123 | 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | - + |
redirects: (size_t)redirects
{
void *pool = objc_autoreleasePoolPush();
OFURL *URL = [request URL];
OFString *scheme = [URL scheme];
of_http_request_type_t requestType = [request requestType];
OFDictionary *headers = [request headers];
|
| ︙ | |||
205 206 207 208 209 210 211 | 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | - + - - + + | if (contentType == nil) contentType = @"application/x-www-form-urlencoded; " @"charset=UTF-8\r\n"; [sock writeFormat: @"Content-Type: %@\r\n", contentType]; [sock writeFormat: @"Content-Length: %d\r\n", |
| ︙ | |||
312 313 314 315 316 317 318 | 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 | - + - + | forKey: key]; continue; } newRequest = [OFHTTPRequest requestWithURL: newURL]; [newRequest setRequestType: requestType]; [newRequest setHeaders: headers]; |
| ︙ |
Modified src/OFHTTPRequest.h from [f5735e078a] to [5980347de8].
| ︙ | |||
31 32 33 34 35 36 37 | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | - + - + |
* @brief A class for storing HTTP requests.
*/
@interface OFHTTPRequest: OFObject
{
OFURL *URL;
of_http_request_type_t requestType;
OFDictionary *headers;
|
| ︙ | |||
111 112 113 114 115 116 117 | 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | - + - + - + | * @return A dictionary with headers for the HTTP request. */ - (OFDictionary*)headers; /*! * @brief Sets the POST data of the HTTP request. * |
| ︙ |
Modified src/OFHTTPRequest.m from [af5623a848] to [4a757213a5].
| ︙ | |||
58 59 60 61 62 63 64 | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | - + |
return self;
}
- (void)dealloc
{
[URL release];
[headers release];
|
| ︙ | |||
94 95 96 97 98 99 100 | 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | - + - + - + - + |
}
- (OFDictionary*)headers
{
OF_GETTER(headers, YES)
}
|
| ︙ | |||
132 133 134 135 136 137 138 | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | - + - - + + |
- initWithStatusCode: (short)status
headers: (OFDictionary*)headers_
data: (OFDataArray*)data_
{
self = [super init];
statusCode = status;
|
| ︙ |
Modified src/OFHTTPServer.m from [2f6eab66c7] to [e6f92f7b1d].
| ︙ | |||
178 179 180 181 182 183 184 | 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | - + | } state; uint8_t HTTPMinorVersion; of_http_request_type_t requestType; OFString *host, *path; uint16_t port; OFMutableDictionary *headers; size_t contentLength; |
| ︙ | |||
215 216 217 218 219 220 221 | 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | - + |
- (void)dealloc
{
[sock release];
[host release];
[path release];
[headers release];
|
| ︙ | |||
328 329 330 331 332 333 334 | 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 | - + |
@try {
contentLength = (size_t)[tmp decimalValue];
} @catch (OFInvalidFormatException *e) {
return [self sendErrorAndClose: 400];
}
buffer = [self allocMemoryWithSize: BUFFER_SIZE];
|
| ︙ | |||
396 397 398 399 400 401 402 | 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 | - + - + |
didReadIntoBuffer: (const char*)buffer
length: (size_t)length
exception: (OFException*)exception
{
if ([sock_ isAtEndOfStream] || exception != nil)
return NO;
|
| ︙ | |||
457 458 459 460 461 462 463 | 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 | - + | [URL setHost: host]; [URL setPort: port]; [URL setPath: path]; request = [OFHTTPRequest requestWithURL: URL]; [request setRequestType: requestType]; [request setHeaders: headers]; |
| ︙ |