{"action":"created","issue":{"url":"https://api.github.com/repos/mgonto/restangular/issues/1006","labels_url":"https://api.github.com/repos/mgonto/restangular/issues/1006/labels{/name}","comments_url":"https://api.github.com/repos/mgonto/restangular/issues/1006/comments","events_url":"https://api.github.com/repos/mgonto/restangular/issues/1006/events","html_url":"https://github.com/mgonto/restangular/issues/1006","id":54487063,"number":1006,"title":"customPUT 'Content-Type': undefined does not override Content-Type Header","user":{"login":"alexleone","id":5570933,"avatar_url":"https://avatars.githubusercontent.com/u/5570933?v=3","gravatar_id":"","url":"https://api.github.com/users/alexleone","html_url":"https://github.com/alexleone","followers_url":"https://api.github.com/users/alexleone/followers","following_url":"https://api.github.com/users/alexleone/following{/other_user}","gists_url":"https://api.github.com/users/alexleone/gists{/gist_id}","starred_url":"https://api.github.com/users/alexleone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexleone/subscriptions","organizations_url":"https://api.github.com/users/alexleone/orgs","repos_url":"https://api.github.com/users/alexleone/repos","events_url":"https://api.github.com/users/alexleone/events{/privacy}","received_events_url":"https://api.github.com/users/alexleone/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-15T18:41:06Z","updated_at":"2015-02-21T12:01:01Z","closed_at":"2015-02-21T12:01:01Z","body":"When using restangular to upload a file I need to use the header Content-Type= undefined to that the correct multipart/form and boundary types get set properly. \r\nIt seems the inherit problem is that when passing in 'Content-Type': undefined it has no effect on the headers.\r\n\r\nThis is my restangular call: \r\nRestangular.all('applications/' + id).withHttpConfig({ transformRequest: angular.identity }).\r\n          customPUT(formData, null, null, {'Content-Type': undefined, 'Accept':'*/*'}).then(\r\n          function(response){\r\n              return response;\r\n          }, function(error){\r\n              return error;\r\n          }\r\n        );\r\n\r\nThe function that data that is being passed in formData.\r\nvar formData = new FormData();\r\n      formData.append('data[name]',  'someName');\r\n\r\nThe important headers:\r\nAccept:*/*\r\nCache-Control:no-cache\r\nConnection:keep-alive\r\nContent-Length:146\r\nContent-Type:application/json\r\n\r\nThe Request Payload:\r\n------WebKitFormBoundaryQGOVo6A0Fp71Dwnq\r\nContent-Disposition: form-data; name=\"data[name]\"\r\n\r\nwhats\r\n------WebKitFormBoundaryQGOVo6A0Fp71Dwnq--\r\n\r\n\r\n\r\n\r\nSo because the restangular does not  respect the Content-Type:undefined it gets the default application/json and doesnt add the correct multipart/form or boundary=\r\n\r\n\r\n\r\n\r\nUsing $http this does work:\r\n$http.put('applications/' + id, formData, {\r\n          withCredentials: true,\r\n          headers: {'Content-Type': undefined },\r\n          transformRequest: angular.identity\r\n        }).success(function(response){\r\n          return response;\r\n        } ).error(function(error){\r\n          return error;\r\n        });\r\n\r\nSam data as before ----The function that data that is being passed in formData.\r\nvar formData = new FormData();\r\n      formData.append('data[name]',  'someName');\r\n\r\n\r\nRequest Headers:\r\nAccept:application/json, text/plain, */*\r\nCache-Control:no-cache\r\nConnection:keep-alive\r\nContent-Length:153\r\nContent-Type:multipart/form-data; boundary=----WebKitFormBoundary6tnxO2dU0ORAyAyu\r\n\r\n\r\nRequest Payload:\r\n------WebKitFormBoundary6tnxO2dU0ORAyAyu\r\nContent-Disposition: form-data; name=\"data[name]\"\r\n\r\ndasadsadsasd\r\n------WebKitFormBoundary6tnxO2dU0ORAyAyu--\r\n\r\n\r\n\r\nIf you have any ideas on this one it would be appreciated. \r\n"},"comment":{"url":"https://api.github.com/repos/mgonto/restangular/issues/comments/75368759","html_url":"https://github.com/mgonto/restangular/issues/1006#issuecomment-75368759","issue_url":"https://api.github.com/repos/mgonto/restangular/issues/1006","id":75368759,"user":{"login":"grabbou","id":2464966,"avatar_url":"https://avatars.githubusercontent.com/u/2464966?v=3","gravatar_id":"","url":"https://api.github.com/users/grabbou","html_url":"https://github.com/grabbou","followers_url":"https://api.github.com/users/grabbou/followers","following_url":"https://api.github.com/users/grabbou/following{/other_user}","gists_url":"https://api.github.com/users/grabbou/gists{/gist_id}","starred_url":"https://api.github.com/users/grabbou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grabbou/subscriptions","organizations_url":"https://api.github.com/users/grabbou/orgs","repos_url":"https://api.github.com/users/grabbou/repos","events_url":"https://api.github.com/users/grabbou/events{/privacy}","received_events_url":"https://api.github.com/users/grabbou/received_events","type":"User","site_admin":false},"created_at":"2015-02-21T12:01:01Z","updated_at":"2015-02-21T12:01:01Z","body":"https://github.com/mgonto/restangular#addfullrequestinterceptor\r\n\r\nPlease use `addFullRequestInterceptor` to manipulate `headers` that are about to be send :)"}}