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 8448887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:32:43+00:00 2026-06-10T10:32:43+00:00

I am only a beginning stage iOS developer, but I am a full time

  • 0

I am only a beginning stage iOS developer, but I am a full time PHP developer. My iOS developer’s application calls my web service over POST, but for whatever reason, my web service is not receiving the response properly.

Here is the Objective-C code that he has developed:

NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
NSData* requestData = [NSData dataWithBytes:[@"{\"method\":\"referrals\",
\"params\":
[{\"iv\":\"some iv value\",
\"data\":
{\"first_name\":\"pEBquIatFcWCrgEVHFhzhw==\",
\"cellular_ipv4\":\"ypMBZu80ZIeVrTpEH0daTg==\",
\"last_name\":\"353YvmRmSw9sKQ+lBrKKcg==\",
\"email\":\"tTiWcT14kuVVgmKuu7PoIw==\",
\"sent_via\":\"69JPdtxeHCAdG/cECGYg5A==\"}
}],
\"id\":\"1\"}" UTF8String] length:[reqString length]];


[request setHTTPMethod:@"POST"];
[request setValue:[NSString stringWithFormat:@"%d", [requestData length]] forHTTPHeaderField:@"Content-Length"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody: requestData];


if (urlConnection != nil) {
[urlConnection release];
urlConnection = nil;
}


urlConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES];
[request release];

As far as we can tell, it is sending the data via POST attached to the key ‘referrals’. However, when my PHP web service checks the $_POST variable for the ‘referrals’ key, it does not find it. Here is the relevant PHP code:

if(array_key_exists('referrals', $_POST))
{
    //some code
}else
{
    //error response
}

// Send JSON response
//header('Content-type: application/json');
echo $message;

The iOS app consistently gets back the error response, which is only set if ‘referrals’ does not exist in $_POST. I’ve Unit Tested the PHP web service using CURL and get successful results consistently.

Where does the error lie?

  • 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-06-10T10:32:45+00:00Added an answer on June 10, 2026 at 10:32 am

    It turns out that the PHP code was not the issue, but the method he was using to send the request over POST. I was never able to find out from him definitively what the specific issue was as he had to rewrite it several times in order to get it to work. From my understanding, the Objective-C way of sending POST data had to be tweaked.

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

Sidebar

Related Questions

Only editor can post into database but the price could'nt Post into database.. So,
strip_tags only catches tags that have a beginning and end tag. With the strings
At the beginning my stage is empty, I've an empty array and some global
Only a few people recommended to use Sphinx at the beginning of the year.
I'm using C# in VS2010 and I need some help with a web application.
I'm beginning to design a web-based API and the very first issue—how will users
OK lets start at the beginning, we are at a stage that we need
I'm beginning to build a stamp collecting web app. Python/flask backend (i think :))
Sorry that this is very much a beginner's question, but yes, I'm only just
I have a web service with two methods: RetrieveFirstLevelOptions() and RetrieveSecondLevelOptions(int levelOneOption). The GUI

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.