Monday 12 June 2017

Curl not working in Windows Node.js

I'm currently trying to make an HTTP server in Node.js and I'm using curl to send POST and GET data, but I'm not able to use curl because it returns as access denied.

My code:

var http = require('http');
var cookieParser = require('cookie-parser');
var connect = require('connect');
var app = connect();
// setup middleware
app.use(cookieParser());
// actually respond
app.use(function(req, res) {
res.end(JSON.stringify(req.cookies));
});
http.createServer(app).listen(8080);

I'm trying to do the following command in curl:

curl -b 'a=b; c=d' http://localhost:8080

But it returns:

Access denied, this application can not be used on your PC. To locate a version for your PC, consult your software provider.

I installed curl.exe in% windir% to be accessible on the command line, and even running through system32, to have full admin permission, it returns as access denied. What can I do to fix this?



via Monteiro

No comments:

Post a Comment