mjrgit / chrome-rest-client

Automatically exported from code.google.com/p/chrome-rest-client
0 stars 0 forks source link

A network error occurred in synchronous requests. #146

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. run node.js on port 3000
2. attempt to post form data to the code below
3.

What is the expected output? What do you see instead?
expected output is post username 

On what operating system?
windows 7

Please provide any additional information below.

/**
 * Module dependencies.
 */

var express = require('express') 
  , http = require('http');

var app = express();

app.configure(function(){
  app.set('port', process.env.PORT || 3000);
  app.use(express.bodyParser());

});

//app.get('/', routes.index);
//app.get('/users', user.list);

app.post("/users", function(req, res){
res.send("creating user with name" + req.body.username + ".");
});

http.createServer(app).listen(app.get('port'), function(){
  console.log("Express server listening on port " + app.get('port'));
});

Original issue reported on code.google.com by a8025...@gmail.com on 19 Jan 2013 at 10:08

GoogleCodeExporter commented 8 years ago
It is working for me. What kind of data you sending? What is payload encoding 
and payload itself?

I modified your code in lines:

app.post("/users", function(req, res){
   console.log("POST USERNAME: " + req.body.username );
   res.send("creating user with name" + req.body.username + ".");
});

See attached screenshot for results.

Original comment by jarro...@gmail.com on 19 Jan 2013 at 11:24

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks, I have released my error. I wasnt putting HTTP:// before the route. 
Sincerely A
appologise

Original comment by a8025...@gmail.com on 20 Jan 2013 at 8:01

GoogleCodeExporter commented 8 years ago
That's alright.
Happy coding :)

Original comment by jarro...@gmail.com on 20 Jan 2013 at 10:08