Avoid AFHTTPClient adding an unnecessary parameter when constructing a multipart request with nil parameters.
This commit is contained in:
parent
c4f07c4b07
commit
61047bac76
1 changed files with 12 additions and 10 deletions
|
|
@ -492,16 +492,18 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
|
||||||
NSMutableURLRequest *request = [self requestWithMethod:method path:path parameters:nil];
|
NSMutableURLRequest *request = [self requestWithMethod:method path:path parameters:nil];
|
||||||
__block AFMultipartFormData *formData = [[[AFMultipartFormData alloc] initWithURLRequest:request stringEncoding:self.stringEncoding] autorelease];
|
__block AFMultipartFormData *formData = [[[AFMultipartFormData alloc] initWithURLRequest:request stringEncoding:self.stringEncoding] autorelease];
|
||||||
|
|
||||||
for (AFQueryStringComponent *component in AFQueryStringComponentsFromKeyAndValue(nil, parameters)) {
|
if (parameters) {
|
||||||
NSData *data = nil;
|
for (AFQueryStringComponent *component in AFQueryStringComponentsFromKeyAndValue(nil, parameters)) {
|
||||||
if ([component.value isKindOfClass:[NSData class]]) {
|
NSData *data = nil;
|
||||||
data = component.value;
|
if ([component.value isKindOfClass:[NSData class]]) {
|
||||||
} else {
|
data = component.value;
|
||||||
data = [[component.value description] dataUsingEncoding:self.stringEncoding];
|
} else {
|
||||||
}
|
data = [[component.value description] dataUsingEncoding:self.stringEncoding];
|
||||||
|
}
|
||||||
if (data) {
|
|
||||||
[formData appendPartWithFormData:data name:[component.key description]];
|
if (data) {
|
||||||
|
[formData appendPartWithFormData:data name:[component.key description]];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue