vue-resource icon indicating copy to clipboard operation
vue-resource copied to clipboard

this.$http.delete 无法使用application/x-www-form-urlencoded

Open wangxiaoyao opened this issue 8 years ago • 1 comments

                        this.$http.delete(this.deleteProductUrl, {
				ids: goodsId
			}, {
				"Content-Type": "application/x-www-form-urlencoded"
			}, {
				emulateJSON: true
			}).then((response) => {
				alert(response.data.reason)
			})

但是在控制台查看头部信息:

怎样使用参数请选择 body(主体) x-www-form-urlencoded 进行传递参数?

wangxiaoyao avatar Jun 05 '17 07:06 wangxiaoyao

Please check your params:

this.$http.delete(url, [options]).then(xxxx)

this.$http.delete(this.deleteProductUrl, {
  params: {
    ids: goodsId
  },
  emulateJSON: true
}).then((response) => {
  alert(response.data.reason)
})

https://github.com/pagekit/vue-resource/blob/develop/docs/http.md#methods

lc-soft avatar Jul 27 '17 09:07 lc-soft