Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Classes/Framework/FMEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
- (NSURL *)generateURLFromDictionary:(NSDictionary *)dict;

- (void)performMethod:(NSString *)method withTarget:(id)target withParameters:(NSDictionary *)params andAction:(SEL)callback useSignature:(BOOL)useSig httpMethod:(NSString *)httpMethod;
- (NSData *)dataForMethod:(NSString *)method withParameters:(NSDictionary *)params useSignature:(BOOL)useSig httpMethod:(NSString *)httpMethod error:(NSError *)err;
- (NSData *)dataForMethod:(NSString *)method withParameters:(NSDictionary *)params useSignature:(BOOL)useSig httpMethod:(NSString *)httpMethod error:(NSError **)err;


@end
12 changes: 6 additions & 6 deletions Classes/Framework/FMEngine.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ - (void)performMethod:(NSString *)method withTarget:(id)target withParameters:(N
request = [NSURLRequest requestWithURL:dataURL];
} else {
#ifdef _USE_JSON_
request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:[_LASTFM_BASEURL_ stringByAppendingString:@"?format=json"]]];
request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[_LASTFM_BASEURL_ stringByAppendingString:@"?format=json"]]];
#else
request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:_LASTFM_BASEURL_]];
request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:_LASTFM_BASEURL_]];
#endif
[request setHTTPMethod:httpMethod];
[request setHTTPBody:[[self generatePOSTBodyFromDictionary:params] dataUsingEncoding:NSUTF8StringEncoding]];
Expand All @@ -74,7 +74,7 @@ - (void)performMethod:(NSString *)method withTarget:(id)target withParameters:(N

}

- (NSData *)dataForMethod:(NSString *)method withParameters:(NSDictionary *)params useSignature:(BOOL)useSig httpMethod:(NSString *)httpMethod error:(NSError *)err {
- (NSData *)dataForMethod:(NSString *)method withParameters:(NSDictionary *)params useSignature:(BOOL)useSig httpMethod:(NSString *)httpMethod error:(NSError **)err {
NSString *dataSig;
NSMutableURLRequest *request;
NSMutableDictionary *tempDict = [[NSMutableDictionary alloc] initWithDictionary:params];
Expand All @@ -101,16 +101,16 @@ - (NSData *)dataForMethod:(NSString *)method withParameters:(NSDictionary *)para
request = [NSURLRequest requestWithURL:dataURL];
} else {
#ifdef _USE_JSON_
request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:[_LASTFM_BASEURL_ stringByAppendingString:@"?format=json"]]];
request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[_LASTFM_BASEURL_ stringByAppendingString:@"?format=json"]]];
#else
request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:_LASTFM_BASEURL_]];
request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:_LASTFM_BASEURL_]];
#endif

[request setHTTPMethod:httpMethod];
[request setHTTPBody:[[self generatePOSTBodyFromDictionary:params] dataUsingEncoding:NSUTF8StringEncoding]];
}

NSData *returnData = [FMEngineURLConnection sendSynchronousRequest:request returningResponse:nil error:&err];
NSData *returnData = [FMEngineURLConnection sendSynchronousRequest:request returningResponse:nil error:err];
return returnData;
}

Expand Down