我正在尝试创建一个执行简单POST httprequest的Polymer组件。
<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":[email protected]}'>
</core-ajax>
</template>
这是,我总是收到ERR 400,错误的请求。
body='{"email":[email protected]}'
应该是body='{"email":"[email protected]"}'
。注意电子邮件周围的引号。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句