according to http://en.wikipedia.org/
I am using express 4.
How to do it?
My index.is is:
var retrieve = function(req, res) {
  console.log("request", req.body);
};
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
app.use(bodyParser.json()); // for parsing application/json
app.get('/retrieve', retrieve); 
app.listen(3000);
> according to http://en.wikipedia.org/wiki/
A GET request does not have a body. (You can send a body with any kind of request, but a body is supposed to have no meaning for GET requests, so it is not useful to send a body with a GET request.) If you want to send a body with your request and have it mean something, then you'll want to send a POST request or a PUT request.
A GET request does not have a body. (You can send a body with any kind of request, but a body is supposed to have no meaning for GET requests, so it is not useful to send a body with a GET request.) If you want to send a body with your request and have it mean something, then you'll want to send a POST request or a PUT request.
 
댓글 없음:
댓글 쓰기