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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:00:44+00:00 2026-06-01T10:00:44+00:00

I was able to use the code in this answer to access a value

  • 0

I was able to use the code in this answer to access a value in a JSON string posted to the server.

If the server gets {"MyKey":"My Value"} then the value for "MyKey" can be accessed with request.body.MyKey.

But the JSON strings that get sent to my server look like this:

[{"id":"1","name":"Aaa"},{"id":"2","name":"Bbb"}]

I could not find a way to access anything in that. How do you do it?

  • 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-01T10:00:46+00:00Added an answer on June 1, 2026 at 10:00 am

    request.body is a standard JavaScript object and in your case a vanilla JavaScript array. You would just handle request.body like you would any JavaScript Array object. e.g.

    app.post('/', function(request, response){
      var users = request.body;
      console.log(users.length);   // the length of the array
    
      var firstUser = users[0];    // access first element in array
      console.log(firstUser.name); // log the name
    
      users.forEach(function(item) { console.log(item) }); // iterate the array logging each item
    
      ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In code: //I know that to get this effect (being able to use it
If I use this code in my Manifest file: <activity android:name=.MyAct android:label=@string/app_name android:configChanges=orientation|keyboardHidden> //<-SEE
The init() is able to use the parameter passed to it in this example:
In order to be able to use this awesome plugin: Jquery iphone contacts i
I have searched around for an answer to this but can't find one. When
I haven't been able to find the answer to this anywhere (it's quite possible
I have not been able to find an answer for this on Google. I
I have an app that needs to be able use either an sqlite3 datebase
Is anyone able to use Scala IDE in Eclipse with syntax highlighting showing different
I want to be able to use mklink to create symbolic links on my

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.