Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

How to send empty array field with can.ajax

$
0
0
I understand that can.ajax is a wrapper for jQuery.ajax, so the question is not refereed to can.js directly.

But as I want to update the model data it uses can.ajax to communicated the server.

So simple example (without any models)

  1. var data =  {name: 'Alex', items:[]}

  2. can.ajax({url: url, type: 'PUT', data: data})
Server parses the data and there is only {name: 'Alex'}, no items empty array.

In request explorer I see:
Form Data
  1. name:
    Alex

Is it possible some how to send data object with ```items: []``` not being omitted?


Viewing all articles
Browse latest Browse all 3491

Trending Articles