Parse.com Http请求体参数使用'或'不同

时间:2015-02-05 16:12:06

标签: javascript parse-platform httprequest quotes double-quotes

我希望将正文的关键值作为变量发送,但是在代码中它不起作用。究竟是什么区别,我如何通过使用变量来解决这个问题。我认为问题是由JS字典的基本特征引起的,但是找不到任何相关的东西。

var withq = 'entry_xxx';
var withdoubleq = "entry_xxx";

Parse.Cloud.httpRequest({
    method: 'POST',
    url: doc_url,
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
    },
    body: {
        'entry_xxx' : object, // works
  },
})

Parse.Cloud.httpRequest({
    method: 'POST',
    url: doc_url,
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
    },
    body: {
        "entry_xxx" : object, // doesn't work
  },
})

Parse.Cloud.httpRequest({
    method: 'POST',
    url: doc_url,
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
    },
    body: {
        withq : object,       // doesn't work 
  },
})

Parse.Cloud.httpRequest({
    method: 'POST',
    url: doc_url,
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
    },
    body: {
        withdoubleq : object  // doesn't work
  },
})

0 个答案:

没有答案