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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:51:06+00:00 2026-06-13T12:51:06+00:00

NSDictionary *customerDictionary = [NSDictionary dictionaryWithObjectsAndKeys:@blah@blah.com, @email, @1, @facebook, nil]; NSArray *customerArray = [NSArray arrayWithObjects:customerDictionary,

  • 0
NSDictionary *customerDictionary = [NSDictionary dictionaryWithObjectsAndKeys:@"blah@blah.com", @"email", @"1", @"facebook", nil];
NSArray *customerArray = [NSArray arrayWithObjects:customerDictionary, nil];
NSDictionary *parameters = [NSDictionary dictionaryWithObjectsAndKeys:customerArray, @"customers", nil];
NSURLRequest *request = [sharedHTTPClient requestWithMethod:@"POST" path:@"/api/upload" parameters:parameters];
AFJSONRequestOperation *operation =
    [AFJSONRequestOperation JSONRequestOperationWithRequest:request
                                                    success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {}
                                                    failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) {}];
[operation start];

On a Node.JS backend, printing out the body shows:

{ customers: [ '1', 'blah@blah.com' ] }

Expected print should be:

{ customers: [{ facebook:'1', email:'blah@blah.com' }] }

What am I doing wrong?

  • 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-13T12:51:07+00:00Added an answer on June 13, 2026 at 12:51 pm

    From the AFNetworking wiki:

    How do I send JSON parameters in my request?

    If you’re using AFHTTPClient, set the parameterEncoding property to
    AFJSONParameterEncoding. Any method on that HTTP client with a
    parameters argument will now encode the passed object into a JSON
    string and set the HTTP body and Content-Type header appropriately.

    Otherwise, you can do this manually by adding the header Content-Type:
    application/json, and setting the body of your request to a JSON
    string.

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

Sidebar

Related Questions

I have this code NSDictionary *tempDict = [NSDictionary dictionaryWithObjects: [NSArray arrayWithObjects:@authorId,authorName,authorDescription,@image,nil] forKeys: [NSArray arrayWithObjects:@id,@name,@desc,@image,nil]];
Code: [self.menuList addObject:[NSDictionary dictionaryWithObjectsAndKeys: NSLocalizedString(@PropertySubtype2fTitle, @), kTitleKey, publishNoOfRoomsViewController, kViewControllerKey, nil]]; menuList is a NSMutableArray.
Why does this code...: NSDictionary *testDictionary = [NSDictionary dictionaryWithObjectsAndKeys:kABOtherLabel, @other, kABWorkLabel, @work, nil]; //
NSDictionary *bundle = [NSDictionary dictionaryWithObjectsAndKeys:message,@message, toUserName, @receiver,fromUserName, @sender, nil]; NSData *data = [NSKeyedArchiver archivedDataWithRootObject:bundle];
NSDictionary *item = [NSDictionary dictionaryWithObjectsAndKeys: eyeNameHolder,@eye, lipsNameHolder,@lips,nil]; NSMutableArray *arrayItems = [NSMutableArray arrayWithObject:item]; [arrayItems insertObject:item
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:@Please, other format selected., NSLocalizedDescriptionKey, @This format is not available.,
I have some NSDictionary objects stored in an NSArray called telephoneArray . I fetch
I have an NSDictionary and I have to add it to a NSArray. How
NSDictionary has the following method signature: - (NSArray *)objectsForKeys:(NSArray *)keys notFoundMarker:(id)anObject; My question(s): Is
NSDictionary *attributes = nil ; *attributes = [filemanager attributesOfItemAtPath:path error:nil] ; fails with ...

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.