I've been attempting to include extra information in my backbone destroy method
.
I've tested the following approaches, but none of them seem to be effective:
model.destroy({'contentType': 'application/json', 'data': {'wow': 1} })
model.destroy({'headers': {'wow': 1}})
model.destroy({'data': {'wow': 1}})
Can someone help me understand what I might be doing incorrectly? I can't seem to get it to work.
EDIT: Following advice from @MorKadosh, I included processData in the request.
model.destroy({data: {wow: 1}, processData: true})
In the network request, I can observe that 'wow' is being transmitted as form data.
Now, on the backend, I'm using Tastypie. How do I retrieve 'wow' in obj_delete of Tastypie?
Tasypie's obj_delete accepts bundle and **kwargs. I have printed out the following, but none of them contain 'wow'.
print bundle.data
for name, value in kwargs.items:
print name, value
print bundle.request
Am I overlooking something?