Trying to post information for nested parameters to a rails app and having some trouble.
#pragma mark - Begin Network Operations
- (void)beginNetworkOperation {
NSURL *requestURL = [NSURL URLWithString:[self retrieveURL]];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:requestURL];
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0
[request setShouldContinueWhenAppEntersBackground:YES];
#endif
[request setRequestMethod:@"PUT"];
[request addRequestHeader:@"Content-Type" value:@"application/json"];
[request addPostValue:strClientId forKey:@"client_id"];
[request addPostValue:strAccessToken forKey:@"access_token"];
NSDictionary *assetDictionary = [NSDictionary dictionaryWithObject:self.tags forKey:@"tags"];
[request addPostValue:assetDictionary forKey:@"asset"];
[request setDelegate:self];
[request setDidFinishSelector:@selector(requestFinished:)];
[request setDidFailSelector:@selector(requestFailed:)];
[request startSynchronous];
}
self.tags is just a NSString with comma separated values, however once arriving at the rails server the tags parameter cannot be read (params[:asset][:tags]).