Best Practices: send client side data to server

After spending some time working on a couple projects using node js and express. I’m wondering about the best practices for sending client data to the server. Typically i’m doing this using ajax calls. I’m wondering if this is the best practice or if there is another way. Any feedback would be great, thanks.

Typical scenario:
Client Side

  • The user takes some action
  • javascript captures these events
  • then using ajax i’ll send that across to the server.

Server Side

  • Express route will handle the client data via some REST verb(GET, POST, DELETE…)
  • server will process the data the send the res. back to the client.

To be clear, what you’re using isn’t AJAX, it’s HTTP. AJAX is about using JavaScript to manipulate the markup on a webpage, and we happen to use HTTP calls to get this new data. To address your concerns, you should feel confident that you’re doing the right thing by using a RESTful API to send data to a server. In fact, there aren’t many other options!

@PortableStick that makes sense, thanks for the clarification.