too long

I hope that someone could help me and I would really appreciate if somebody has an answer to my problem I'm developing an iOS app that makes some HTTP request to a server that runs Laravel framework The server exposes some services that I call with a HTTP POST method and sending a JSON in the HTTP body I create the JSON starting from an NSMutableDictionary object in this way

//Serialize parameters
NSError *error = nil;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:parameters
                                                   options:kNilOptions
                                                     error:&error];

And then I valorize my HTTP request

// Prepare the request
[request setHTTPMethod:@"POST"];
[request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request setValue:@"json" forHTTPHeaderField:@"Data-Type"];
[request setValue:[NSString stringWithFormat:@"%d", (int)[jsonData length]]  forHTTPHeaderField:@"Content-Length"];
[request setHTTPBody:jsonData];

The problem is that sometimes the server doesn't receive my data correctly Sometimes Laravel detects a GET request instead of a POST request Other times Laravel receives my JSON but in a different format that cannot be processed (such as missing quotes, semicolumns, commas, and so on) This happens randomly, indeed if I try again 30 minutes later it works again

In addition, this happens only with iOS (since we are developing also an android version of the same app and we have no issues for this one)

Thanks in advance for anyone who will help me Tarek

Debug your code if you dont have same issue on android then the server totally works as expected

I prefer to log your body of request(json) or watch the traffic if debugging might be hard