I'm just trying to receive data in my server from ajax post.
My server receives the request normally but the req.body is an an empty object {}.Normaly I would send an object from JS looking like this {username: "holiday"}
. I can't find a way to send this via AJAX construct. It must be possible...
Edit:
Setting header "Content-Type" to "application/json" allows data to be send via req.body, but I can't figure out how to correctly send the data from above.
I used the "Authorization" header to send the username with, which works, but far from ideal...