1
我有一個jQuery後像如何發送一個javascript數組CherryPy的
var arr = ['some', 'string', 'array'];
jQuery.post('saveTheValues', { 'values': arr },
function(data)
{
//do stuff with the returned data
}, 'json'
);
而且它進入一個cheerypy功能:
@cherrypy.expose
def saveTheValues(self, values=None):
#code to save the values
但是運行的JavaScript回報400 Bad Request
因爲Unexpected body parameters: values[]
。
如何將數組發送給cherrypy?
我有一個相關的問題。你的回答幫助了我,但我仍然需要幫助。你願意看看我的問題嗎? [鏈接](http://stackoverflow.com/questions/23463617/pass-javascript-array-to-cherrypy-with-ajax) –