Skip to content

Instantly share code, notes, and snippets.

@harbhub
Created September 23, 2012 05:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harbhub/3768970 to your computer and use it in GitHub Desktop.
Save harbhub/3768970 to your computer and use it in GitHub Desktop.
CLIENT SIDE
$(document).ready(function () {
var myData = $('#myInput').val();
$.ajax({
url: 'http://localhost:8888/what',
data: {name: 'Mike', something: 'another value i want'},
dataType: 'text',
type: 'POST'
}).done(function(data) {
alert('The Data: ' + data);
});
});
SERVER SIDE
app.post('/what', function (request, response) {
console.log(request.headers);
console.log(request.body);
response.end('Hello');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment