when method is GET and TRACE, useBody becomes always false
This commit is contained in:
parent
1a6554423d
commit
b86805ada3
1 changed files with 1 additions and 1 deletions
|
|
@ -43,7 +43,7 @@ module.exports = function($window, Promise) {
|
||||||
if (args.method == null) args.method = "GET"
|
if (args.method == null) args.method = "GET"
|
||||||
args.method = args.method.toUpperCase()
|
args.method = args.method.toUpperCase()
|
||||||
|
|
||||||
var useBody = typeof args.useBody === "boolean" ? args.useBody : args.method !== "GET" && args.method !== "TRACE"
|
var useBody = (args.method === "GET" || args.method === "TRACE") ? false : (typeof args.useBody === "boolean" ? args.useBody : true)
|
||||||
|
|
||||||
if (typeof args.serialize !== "function") args.serialize = typeof FormData !== "undefined" && args.data instanceof FormData ? function(value) {return value} : JSON.stringify
|
if (typeof args.serialize !== "function") args.serialize = typeof FormData !== "undefined" && args.data instanceof FormData ? function(value) {return value} : JSON.stringify
|
||||||
if (typeof args.deserialize !== "function") args.deserialize = deserialize
|
if (typeof args.deserialize !== "function") args.deserialize = deserialize
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue