76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
@throw [OFInvalidArgumentException exception];
}
@implementation OFHTTPRequest
@synthesize URL = _URL, method = _method, headers = _headers;
+ (instancetype)request
{
return [[[self alloc] init] autorelease];
}
+ (instancetype)requestWithURL: (OFURL *)URL
{
return [[[self alloc] initWithURL: URL] autorelease];
}
- (instancetype)init
{
self = [super init];
_method = OFHTTPRequestMethodGet;
_protocolVersion.major = 1;
_protocolVersion.minor = 1;
return self;
}
- (instancetype)initWithURL: (OFURL *)URL
{
self = [self init];
@try {
_URL = [URL copy];
} @catch (id e) {
[self release];
@throw e;
}
return self;
}
- (void)dealloc
{
[_URL release];
[_headers release];
[super dealloc];
|
<
<
<
<
<
|
>
>
|
|
|
<
<
<
<
<
<
<
<
<
<
>
>
>
>
>
|
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
@throw [OFInvalidArgumentException exception];
}
@implementation OFHTTPRequest
@synthesize URL = _URL, method = _method, headers = _headers;
+ (instancetype)requestWithURL: (OFURL *)URL
{
return [[[self alloc] initWithURL: URL] autorelease];
}
- (instancetype)initWithURL: (OFURL *)URL
{
self = [super init];
@try {
_URL = [URL copy];
_method = OFHTTPRequestMethodGet;
_protocolVersion.major = 1;
_protocolVersion.minor = 1;
} @catch (id e) {
[self release];
@throw e;
}
return self;
}
- (instancetype)init
{
OF_INVALID_INIT_METHOD
}
- (void)dealloc
{
[_URL release];
[_headers release];
[super dealloc];
|