Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

240
Views
How to handle table JSON/form data from the body of the URL in node.JS and express

I have a question in node js express. My question concerns post request with node js express. I want to make a post request for this data in json form. Below you can find the node js express code and the post I want to do.

node js express code:

var express = require('express');

var app = express();

app.use(express.json()); // built-in middleware for express

app.post('/', function(request, response){
    let myJson = request.body;      // your JSON
    let myValue = request.body.II.A;    // a value from your JSON
    response.send(myJson);   // echo the result back
});

app.listen(3000);

======================

The body of the post in json format:

{
            "I" : {
                "Y" : "3",
                "Z" : "2",
                "T" : "1"
            },
            "II" : [
                {
                    "A" : "4",
                    "B" : "5",
                    "C" : {"a": "4", "b" : "6"},
       
                }
            ]
        }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

use this code to get body data from post API.

var express = require('express');
var bodyParser = require("body-parser");

var app = express();

app.use(express.json()); // built-in middleware for express
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

app.post('/', function(request, response){
    let myJson = request.body;      // your JSON
    let myValue = request.body.II.A;    // a value from your JSON
    response.send(myJson);   // echo the result back
});

app.listen(3000);
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!