Closed triage closed 11 years ago
Just checked, it's still there. Ref: https://github.com/MugunthKumar/MKNetworkKit/blob/master/MKNetworkKit/Categories/NSString+MKNetworkKitAdditions.h
Are you sure you're using the correct version of MKNetworkKit?
apologies. had to have :head in the podfile
No prob :)
On 13/02/2013, at 02:33, triage notifications@github.com wrote:
apologies. had to have :head in the podfile
— Reply to this email directly or view it on GitHubhttps://github.com/rsieiro/RSOAuthEngine/issues/15#issuecomment-13474199.
ok ... now that everything compiles, here's the other issue: I'm sending params on a signed operation with a POST MK only ships with NSString+MKNetworkKitAdditions.h/.m, which has the category method mk_urlEncodedString however values in params are likely to be things other than just strings like nsnumber, nsarray, nsdictionary, etc.
in RSOAuthEngine.m, you have: [parameters addObject:[NSDictionary dictionaryWithObjectsAndKeys:[key mk_urlEncodedString], @"key", [obj mk_urlEncodedString], @"value", nil]];
problem is obviously, that value may likely not be an NSString, and so I was getting selector not found [NSCFNumber mk_urlEncodedString]
so what do you think about something like this, starting on lines 218, nearly identical to what MK is doing in NSDictionary+RequestEncoding.m in -(NSString*) urlEncodedKeyValueString
[request.readonlyPostDictionary enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
NSObject *value = obj;
if([value isKindOfClass:[NSString class]])
{
[parameters addObject:[NSDictionary dictionaryWithObjectsAndKeys:[key mk_urlEncodedString], @"key", [obj mk_urlEncodedString], @"value", nil]];
}
else
{
[parameters addObject:@{
@"key":[key mk_urlEncodedString],
@"value":[NSString stringWithFormat:@"%@",value]
}];
}
}];
Yeah, that could be a nice convenience.
I'm currently very busy with a project, so I can't stop to work on this at the moment. But feel free to send a pull request!
will do!
hey there appears that mk_urlEncodedString isn't in MKNetworkKit anymore