Created
September 23, 2012 05:31
-
-
Save harbhub/3768970 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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