【问题标题】:bad request error with polymer component POST function聚合物组件 POST 功能的错误请求错误
【发布时间】:2014-11-03 11:28:16
【问题描述】:

我正在尝试创建一个 Polymer 组件来制作一个简单的 POST httprequest。

<link rel="import" href="/components/core-ajax/core-ajax.html">

<polymer-element name="test-insert">
  <template>

   <core-ajax auto method="POST" contentType="application/json"  url="/api/accounts" body='{"email":user@example.com}'>
</core-ajax>
</template>

这是,我总是收到 ERR 400,错误的请求。

【问题讨论】:

    标签: ajax post request polymer http-status-code-400


    【解决方案1】:

    body='{"email":user@example.com}' 应该是 body='{"email":"user@example.com"}'。请注意电子邮件周围的引号。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-04
      • 1970-01-01
      • 2016-03-23
      • 1970-01-01
      相关资源
      最近更新 更多