Rahul Jiresal
Rahul Jiresal

Reputation: 1006

Server request backbone without a Model object

I have a Backbone application I’ve been making changes to. It is a CMS-like system and we maintain a cache on the server to deliver content faster. However, the cache needs to be cleared when new content is added. So, I added a POST method on the server to clear the “cache” on the server. This call just returns HTTP response 200, or 4xx.

I want to make a call to this from my Backbone application, but there is no model associated with “cache”. I understand that all other requests from the app are either fetch(), save(), destroy() on a model. How do I make requests without a model?

PS. I’m new to Backbone

Upvotes: 1

Views: 227

Answers (1)

Stephen Thomas
Stephen Thomas

Reputation: 14053

You could just do a jQuery POST without bothering about Backbone

$.ajax({
  type: "POST",
  url: url,
  data: data,
  success: success,
  dataType: dataType
});

Upvotes: 2

Related Questions