Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5949397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:14:38+00:00 2026-05-22T17:14:38+00:00

I have a very annoying problem, which I’m trying to solve. I have an

  • 0

I have a very annoying problem, which I’m trying to solve. I have an iPhone app that sends several forms of data to a server. The server-side processes the data and responds, with PHP. With small lengths of data this goes fine, but one of the requests is pretty large and this doesn’t go so well. The requests seems well encoded, with the proper length, even the Content-Length header is set. Still I get an incomplete (literally chopped off) result in PHP.

Here’s some code:

NSString *requestString = [NSString stringWithFormat:@"json=%@", [params JSONFragment], nil];
NSLog(@"%@", requestString);
NSLog(@"%u", [requestString length]);
NSData *requestData = [requestString dataUsingEncoding:NSUTF8StringEncoding];
//NSData *requestData = [NSData dataWithBytes: [requestString UTF8String] length: strlen([requestString UTF8String])]; //[requestString UTF8String]
//NSData *requestData = [NSData dataWithBytes: requestString length: [requestString length]]; //[requestString UTF8String]
//NSData *requestData = [NSData dataWithBytes:[requestString UTF8String] length:[requestString lengthOfBytesUsingEncoding:NSUTF8StringEncoding]];

NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL: [NSURL URLWithString: @"https://radarromance.com/api/index.php"]];
[request setHTTPMethod: @"POST"];
[request setHTTPBody: requestData];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"content-type"];
[request setValue:[NSString stringWithFormat:@"%u", [requestString length], nil] forHTTPHeaderField:@"content-length"];

Consider the actual data to be a properly formatted JSON string, with a length of > 4000 characters. I ran a tiny test to see whether the NSData object had the correct length, and it has. On the iPhone side, I assume, all is fine.

The PHP side however shows only a part of the request, so it’s incomplete. The post_max_size is 16M, which should be sufficient.

How is this possible? What can possibly be wrong? Any help here is greatly appreciated!

Kind regards,

Reinder

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:14:39+00:00Added an answer on May 22, 2026 at 5:14 pm

    I’ve had this problem as well with scraping websites with other http clients, but maybe the solution is the same. I had incomplete requests because my timeout was set to low and downloading (or posting in your case) took to long so it would result in my requests being incomplete. Might be something worth checking!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a layout that is working, but it has one very annoying problem..
I have a very annoying problem that has left me scratching me head when
I have a very annoying problem which is my z-index is not working and
I've recently started using GNU Screen but have run into a very annoying problem.
I've got a very annoying problem with my Zend studio. I have a zend
I have a very annoying exception which freeze my application thrown by WPF, when
I have a very annoying problem on the application I've been contracted to work
I'm facing a very annoying problem. Here's the context : I have a rectangle
I'm running across a very annoying problem regarding transitive const in D. I have
I am having a very annoying problem. I have an application with a setup

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.