I am making a $http DELETE request with a payload but the content-type is wrong. I have a data object, but the content-type is getting set to text/plain instead of application/json. As you can see from the code below and the network request below there is in fact a data object with values. Is there a work around for this? Much Thanks!
code:
$http({
method: "DELETE",
url: ".../v2/places/" + place.id + "/locations/remove",
data: location,
headers: { Authorization: "Bearer " + rootServices.getToken() }
})
chrome network request summary:
Remote Address:54.83.54.37:443
URL:../v2/places/53b43e03e4b00cb25bcb16af/locations/remove
Request Method:DELETE
Status Code:500 Internal Server Error Request
Accept:application/json, text/plain,*/*
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Authorization:Bearer ..... Connection:keep-alive
Content-Length:66
Content-Type:text/plain;charset=UTF-8
Host:sandbox....net
Origin:127.0.0.1:9000
Referer:127.0.0.1:9000/session
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36 Request
Payload: {room:Kitchen, appliance:Refrigerator, floor:Main
Floor}
content-type
header. – lucuma Jul 18 '14 at 16:42