Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

node express post request json

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.myKey;	// a value from your JSON
	response.send(myJson);	 // echo the result back
});

app.listen(3000);
Comment

PREVIOUS NEXT
Code Example
Javascript :: increase-memory-limit not working node 
Javascript :: how to just have createdAt mongoose 
Javascript :: object to query string javascript 
Javascript :: get all values of a select javascrip 
Javascript :: Get Substring between two characters using javascript 
Javascript :: react app using npm 
Javascript :: javascript foreach object key 
Javascript :: how to hash password in node js 
Javascript :: asyncstorage.getallkeys 
Javascript :: angular route change scroll to top 
Javascript :: js xmlhttprequest add header 
Javascript :: sort object by value javascript 
Javascript :: import formik 
Javascript :: how to convert timestamp to date in react native 
Javascript :: cypress enter 
Javascript :: nodejs merge 2 objects 
Javascript :: npm react router dom 
Javascript :: JS class for each 
Javascript :: html print div 
Javascript :: jquery selected option 
Javascript :: javascript element edit value 
Javascript :: convert array to json in js 
Javascript :: how to set content length of an mp3 stream in nodejs 
Javascript :: reactjs compile subdomine 
Javascript :: check radio button is checked jquery 
Javascript :: square every digit javascript 
Javascript :: loopback not null 
Javascript :: javascript removing item from array 
Javascript :: adonisjs livereload 
Javascript :: Configure morgan so that it also shows the data sent in HTTP POST requests: 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =