i am working on a messaging app where all messages are stored in a server on temporary basis.
i have the follwoing code.
NSURL *url = [NSURL URLWithString:[BARAppDelegate returnsendmessageurl]];
ASIFormDataRequest *request1 = [ASIFormDataRequest requestWithURL:url];
[request1 setPostValue:usernameEmailid forKey:@"username"];
[request1 setPostValue:messagebody forKey:@"MessageBody"];
[request1 setPostValue:receipientnumber forKey:@"RecipientMobileNumber"];
[request1 setPostValue:sendermobilenumber forKey:@"SenderMobileNumber"];
[request1 addData:nil withFileName:@"ipodfile.jpg" andContentType:@"application/octet-stream" forKey:@"photos"];
[request1 setDelegate:self];
[request1 setPersistentConnectionTimeoutSeconds:30];
[request1 setShouldAttemptPersistentConnection:YES];
[request1 startAsynchronous];
when i check the database on the server , surprisingly it has taken only null values for all the parameters(usernameEmailid ,messagebody,receipientnumber,sendermobilenumber). i NSLoged all those values just before the i put the request and they seem to be fine.
NOTE : this does not happen all the time. it happens few times . Also this happens only when i am trying to reply to an existing message that i have in the inbox. it does not happen when i try to send a new message.
am i doing something wrong here?
You are using and asynchronous connection and to be able to know if something went wrong on your side or the server side you should implement the following methods before you call
Add this:
And implement this methods: