I don't think it is a CORS issues as POST requests work, you can see in the 
image, what the response contains.

Am I missing something that is special for PUT and DELETE?

On Wednesday, 1 October 2014 12:23:24 UTC-4, Eric Eslinger wrote:
>
> This sounds like a CORS issue. Have you looked at the console? I think 
> angular will complain when the options preflight response doesn't have the 
> right CORS headers, and then will just not issue the command. Maybe your 
> backend server isn't putting those headers on the puts and deletes?
>
> e 
>
> On Wed, Oct 1, 2014 at 9:15 AM, Cody Scott <[email protected] 
> <javascript:>> wrote:
>
>> When I try to $http.put or $http.delete a OPTIONS request is sent and 
>> receives a 200 response but the PUT or DELETE request is not sent.
>>
>> This happens in Firefox and Chrome. Here is an image of the Network tab 
>> from Firefox http://i.imgur.com/Ol14L10.png
>>
>> POST works fine.
>>
>> app.factory('Objects', ['$http', '$cacheFactory', function($http, 
>> $cacheFactory){
>>
>>   return {
>>     getLabs: function(){
>>       return $http.get(HOST + '/api/v1.0/labs/all', {cache: true});
>>     },
>>     getLab: function(labId){
>>       return $http.get(HOST + '/api/v1.0/labs/' + labId, {cache: true});
>>     },
>>     createLab: function(data){
>>       return $http.post(HOST + '/api/v1.0/labs/', data=data);
>>     },
>>     updateLab: function(labId, data){
>>       return $http.put(HOST + '/api/v1.0/labs/' + labId, data=data);
>>     },
>>     deleteLab: function(labId){
>>       return $http.delete(HOST + '/api/v1.0/labs/' + labId + '/delete');
>>     },
>>     clearLabs: function(){
>>       var cache = $cacheFactory.get('$http');
>>       cache.remove(HOST + '/api/v1.0/labs/all');
>>     },
>>   };}]);
>>
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "AngularJS" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/angular.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to