Every line of 'app.use(bodyparser.json())' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
12 use(req: Request, res: Response, next: NextFunction) { 13 bodyParser.json(this.options)(req, res, next); 14 }
5 export function bodyJson() { 6 return json(); 7 }
36 use(req: Request, res: Response, next: NextFunction) { 37 bodyParser.text(this.options)(req, res, next); 38 }
14 function body (json) { 15 var result = {}; 16 17 result.list = json; 18 19 result.list = _.map(result.list, function (item) { 20 item.exclude = _.indexOf(obj.excludeValues, item.id) !== -1; 21 22 return item; 23 }); 24 25 return templateService.get("grails-admin-list", result); 26 }
8 function jsonBody(req, res, opts, callback) { 9 var args = parseArguments(req, res, opts, callback) 10 req = args.req 11 res = args.res 12 opts = args.opts 13 callback = args.callback 14 15 if (!callback) { 16 return jsonBody.bind(null, req, res, opts) 17 } 18 19 var parse = opts.JSON ? opts.JSON.parse : jsonParse 20 var reviver = opts.reviver || null 21 22 body(req, res, opts, function (err, body) { 23 if (err) { 24 return callback(err) 25 } 26 27 parse(body, reviver, callback) 28 }) 29 }
316 export function json( 317 req: T.Effect, Response> 318 ): T.Effect, Response> { 319 return T.provideR((r: R & HttpEnv) => ({ ...r, ...jsonDeserializer }))(req); 320 }
87 public json() { 88 return { foo: 1 }; 89 }
31 json(body) { 32 this.request = this.request 33 .send(body) 34 .type('json') 35 .accept('json') 36 .then((resp) => { 37 if (resp.ok) { 38 return resp.body; 39 } 40 41 throw new FetchError(resp.statusText, resp); 42 }, (error) => { 43 if (error.status === 401) { 44 SessionActions.logout(SessionStore.getSessionId()); 45 } 46 47 throw new FetchError(error.statusText, error); 48 }); 49 50 return this; 51 }